You can set up a default scope:

http://ryandaigle.com/articles/2008/11/18/what-s-new-in-edge-rails-default-scoping

Mat

On Tue, Feb 9, 2010 at 09:59, TomRossi7 <[email protected]> wrote:
> Is there a way to specify within a model that an association should
> always be loaded.  For example, the classic example from the API docs:
>
> Post.find(:all, :include => :author)
>
> What if I ALWAYS wanted the author to be loaded whenever a Post object
> was created?  So, in essence, Post.find(:all) would bring back each
> post with the associated author object already loaded.
>
> 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.
>
>

-- 
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.

Reply via email to