I have a parent model object called team, and a child model called team_aliases. Like this: create_table teams do |t| t.column :name, :string end create_table team_aliases do |t| t.column :team_id, :integer t.column :name, :string end For example, there may be a team called: "New York Mets", with aliases of "NY Mets", "Mets", etc. I have defined the teams model so that it "has_many :team_aliases", and the team_aliases model acts_as_list with the scope :team_id. My input data is a list of competitions, where each competition has an associated list of team names ( not team_ids ). Given a competition, the application needs to find the list of matching teams, which should generally be 2 or more. I am trying to implement a find method on the team model that searches on both the team name and the alias names to find matching teams for the given list of names from a competition. def self.find_by_names(names) I have figured out a way to do this with find_by_sql, but I would really prefer to use ActiveRecord find utilities so that I do not have to use sql. This seems like a fairly common pattern which I need to solve for several different models in addition to teams, and I''m wondering if there is a rails preferred way for performing this kind of find method when a model instance can be known by more than one name. Thanks! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---