search for: find_by_inviteable

Displaying 1 result from an estimated 1 matches for "find_by_inviteable".

2006 Jul 26
1
Polymorphic Associations: dynamic finders
Is there any sort of dynamic finder for polymorphic associations? For example if I had: class InviteNode < ActiveRecord::Base belongs_to :inviteable, :polymorphic => true end I would like to be able to search by: InviteNode.find_by_inviteable(some_object) instead of having to do: InviteNode.find_by_inviteable_id_and_inviteable_type(some_object.id, some_object.class.name) obviously I could write my own, but am I missing something? Is there a reason Rails doesn''t provide something like this for you? - steve