Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
class User :has_many :domains, :through => :domain_coordinators :has_many :regions, :through => :regional_coordinators :belongs_to :domain :belongs_to :region def domains_responsible_for self.domains end def regions_responsible_for self.regions # Not very fast code... but will work end end class DomainCoordinator :belongs_to :user :belongs_to :domain end class RegionalCoordinator :belongs_to :user :belongs_to :region end class Domain :has_many :coordinators, :through => :domain_coordinators, :source => :users :has_many :users :belongs_to :region def coordinators self.coordinators end def users self.users end end class Region :has_many :coordinators, :through => :regional_coordinators, :source => :users :has_many :users :has_many :domains def coordinators self.coordinators end def users self.users end end
This paste will be private.
From the Design Piracy series on my blog: