Sha256: 6d3a6d929eb18f2d8e2c12b0500e9623a9aac8909ae839305fd91fdcc89b565c
Contents?: true
Size: 423 Bytes
Versions: 28
Compression:
Stored size: 423 Bytes
Contents
Party.class_eval do has_many :website_party_roles, :dependent => :destroy has_many :websites, :through =>:website_party_roles do def owned where('role_type_id = ?',RoleType.website_owner).collect(&:website) end end def add_website_with_role(website, role_type) self.website_party_roles << WebsitePartyRole.create(:website => website, :role_type => role_type) self.save end end
Version data entries
28 entries across 28 versions & 1 rubygems