Hey everyone,

i can't build AR-Queries with relationships between tables. Here's a
short sample:

class Customer < ActiveRecord::Base
  has_many :projects
end
class Project < ActiveRecord::Base
  belongs_to :customer
end
When I execute the following Code in my Controller: @customers =
Customer.all.includes(:projects)
a NoMethodError (undefined method `includes' for #<Array:0xb679e030>)
is thrown.

Why did i receive an Array and not an Object of the class
ActiveRecord?

Thanks in advance for your help!

Greets, Gerrit

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to