Skip to content

Instantly share code, notes, and snippets.

@antillas21
Created August 30, 2012 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antillas21/3537260 to your computer and use it in GitHub Desktop.
Save antillas21/3537260 to your computer and use it in GitHub Desktop.
class Contact
delegate :vertical, :to => :campaign, :prefix => true
end
class Campaign
delegate :name, :to => :vertical, :prefix => true
end
contact = Contact.find(1)
camp = Campaign.find(2)
contact.campaign_vertical
#=> [vertical object]
camp.vertical_name
#=> [associated vertical name]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment