Skip to content

Instantly share code, notes, and snippets.

@benlangfeld
Created December 10, 2010 12:02
Show Gist options
  • Select an option

  • Save benlangfeld/736128 to your computer and use it in GitHub Desktop.

Select an option

Save benlangfeld/736128 to your computer and use it in GitHub Desktop.
class CallCampaign < ActiveRecord::Base
has_many :campaign_targets, :autosave => true
has_many :call_lists, :through => :campaign_targets
has_many :phone_numbers, :through => :call_lists
end
class CallList < ActiveRecord::Base
attr_accessible :name
has_many :call_list_memberships, :foreign_key => :call_list_id
has_many :phone_numbers, :through => :call_list_memberships
end
class CallListMembership < ActiveRecord::Base
attr_accessible :call_list_id, :phone_number_id
belongs_to :call_list
belongs_to :phone_number
end
class PhoneNumber < ActiveRecord::Base
has_many :call_list_memberships
has_many :call_lists, :through => :call_list_memberships
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment