After some research it seems that's not the cause of the problem. I 
created a blank project, removed all plugins and the error persisted:

> User.last.conversations.find(Conversation.last.id).users.last.instance_of?(User)
=> true
> reload!
Reloading...
=> true
> User.last.conversations.find(Conversation.last.id).users.last.instance_of?(User)
=> false

I removed this line I had in the Conversation model:

  default_scope :order => 'updated_at desc'

Now the models are exactly as shown in my first post, and now there's no 
class bug. Of course, I have been testing with only one user, one 
conversation and one reading (otherwise the order in the default scope 
would make a big change in the query).
-- 
Posted via http://www.ruby-forum.com/.

-- 
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 rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to