Maybe this is an artifact of not using the proper plural of "child"? Try 
"children" instead of "childs". Rails internally works a lot with building 
plurals and singulars. Something could go wrong here.

Other than that it's difficult to tell because you did not show your model 
definition. I'd also recommend using the built-in functions like 
"role.children.build" instead of defining methods like "add_subrole" - that 
may interfere with caching because "role.children" is evaluated lazily in 
Rails3 while "role.children.all" makes it evaluate now. Combined with your 
improper naming scheme this may be the culprit. It looks like you are 
building children outside the knowledge of the relation.

Jones wrote:

> Hi,
> I experience a strange issue in Rails 3.1.0 with activerecord
> 
> https://gist.github.com/1273558
> 
> See the bottom lines of this gist. Why is there a difference in the
> resultset of role.childs and role.childs.all
> 
> This happens in test and development mode.
> 


-- 
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-talk@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