Hi, I''ve got Itineraries, Stops (join model), and Locations. I''d like to be able to do Itinerary.locations.find_by_name(:name) but Locations can have one of several types (Museum, Restaurant, Bar, Train Station, etc) and each one of those can have several names referring to the same instance ("Manny''s Bar", "Manny''s", "The Bar Formerly Known as Manny''s", "The New Roadhouse"). Is there a way to make it work? How do I find_by_name when I don''t know which type of model the name refers to? # Example class Itineraries has_many :stops has_many :locations, :through => :stops class Stops belongs_to :itineraries belongs_to :locations class Locations has_many :stops has_many :itineraries, :through => :stops belongs_to :locationable, :polymorphic => true class Museum has_one :location, :as => :locationable class Bar has_one :location, :as => :locationable --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---