or you could add a named_scope to your photo-model:
named_scope :primary, :conditions => { :primary => true }
then your call could be like:
@primary_photo = @gallery.photos.primary.first
this should be the nicest alternative.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---