Created
May 30, 2013 01:40
-
-
Save coderdan/5675257 to your computer and use it in GitHub Desktop.
Readability for complex associations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| has_many :performances, :dependent => :destroy | |
| has_many :keyword_vendor_instances, | |
| :class_name => 'Scenario::Keyword::VendorInstance', | |
| :foreign_key => :ad_group_vendor_instance_id | |
| has_many :ad_vendor_instances, | |
| :class_name => 'Scenario::Ad::VendorInstance', | |
| :foreign_key => :ad_group_vendor_instance_id | |
| # And not this: | |
| has_many :join_geo_target_scenario_campaign_vendor_instances, :dependent => :destroy, :class_name => 'Join::GeoTargetScenarioCampaignVendorInstance' | |
| has_many :geo_targets, :through => :join_geo_target_scenario_campaign_vendor_instances, :conditions => { :join_geo_target_scenario_campaign_vendor_instances => {:exclusive => false} } | |
| has_many :exclusive_geo_targets, :through => :join_geo_target_scenario_campaign_vendor_instances, :conditions => { :join_geo_target_scenario_campaign_vendor_instances => {:exclusive => true} }, :source => :geo_target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment