Created
September 1, 2011 17:42
-
-
Save diegorv/1186738 to your computer and use it in GitHub Desktop.
This file contains 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
class Client < ActiveRecord::Base | |
has_many :client_companies, :dependent => :destroy | |
has_many :contracts , :dependent => :destroy | |
accepts_nested_attributes_for :client_companies , :allow_destroy => true | |
end | |
class ClientCompany < ActiveRecord::Base | |
belongs_to :client | |
has_many :client_company_addresses, :dependent => :destroy | |
has_many :client_company_contacts , :dependent => :destroy | |
has_many :client_company_employees, :dependent => :destroy | |
has_many :contracts , :dependent => :destroy | |
accepts_nested_attributes_for :client_company_addresses , :allow_destroy => true | |
accepts_nested_attributes_for :client_company_contacts , :allow_destroy => true | |
accepts_nested_attributes_for :client_company_employees , :allow_destroy => true | |
end | |
class ClientCompanyAddress < ActiveRecord::Base | |
belongs_to :client_company | |
end | |
class ClientCompanyContact < ActiveRecord::Base | |
belongs_to :client_company | |
end | |
class ClientCompanyEmployee < ActiveRecord::Base | |
belongs_to :client_company | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment