Greg Hauptmann wrote: > Hi, > > If I want to return SQL data that cuts across multiple models (e.g. > not specific to one mode) how do I do this? Actually the use case > could be either (a) custom SQL I want to call or via (b) SQL call to a > database view I've created?
If I understand your question then the way to do this is through associations defined in your model. You can have more than one association defined between identical tables, each with a different name and select conditions. See: http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---