On Feb 27, 2013, at 4:42 AM, Will Bryant wrote: > Hi guys, > > I don't think that the changes made to the behavior of #all in 4.0 are a very > good idea. > > I can see that you no longer need to call all in as many cases as you did > before - that's fine, just don't call it if you don't want it. But that > doesn't mean you never need it or that people who do need it should not have > it available. > > 1. Yes you can use to_a in many cases, but it behaves differently - for > example if you have an association, to_a will return the cached target if the > association has already been loaded. You absolutely need a way to run an > actual query when you want the latest results. to_a cannot be relied upon to > do this in all cases.
p.tasks(true) will *always* reload the association. I haven't seen the equivalent for relations, though. --Matt Jones -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-core+unsubscr...@googlegroups.com. To post to this group, send email to rubyonrails-core@googlegroups.com. Visit this group at http://groups.google.com/group/rubyonrails-core?hl=en. For more options, visit https://groups.google.com/groups/opt_out.