So are you saying project.documents.reload.first would redo the query to find 
the associated record, or would do a find(id) to reload the current instance?


> On 16/07/2015, at 01:08 , DHH <[email protected]> wrote:
> 
> I'd prefer to see us move to a single API, and IMO the trade-offs for #reload 
> alone fits the bill. There's no contract saying that a singular object from 
> has_one/belongs_to and a collection like has_many has to behave the same. In 
> fact, I think it'd be strange to think that it should. A single string and an 
> array of strings do not behave the same.
> 
> So project.documents.reload.first makes perfect sense to me as reloading the 
> documents collection, then grabbing the first one. projects.owner.reload.name 
> makes sense to me as reloading the owner record itself, then fetching the 
> name (if we don't already return self from Record#reload, we should).
> 
> -- 
> 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 [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at http://groups.google.com/group/rubyonrails-core 
> <http://groups.google.com/group/rubyonrails-core>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to