Hello, I'm using Rails 3 with devise.
I have a table books which has a column for user_id, which is related
to the Users table (user.rb) (FK)
I'm trying to create a Scope that shows all the books along with the
user's email address (Books joined to Users)
Example: Title, Content, User.Email
class Book < ActiveRecord::Base
scope :personal, proc {|user| where(:user_id => user.id) }
end
Can you help me understand why this is erroring with: "Called id for
nil, which would mistakenly be 4 -- if you really wanted the id of
nil, use object_id"
thanks
--
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.