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 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 :users, :through => :domain_coordinators :belongs_to :region def coordinators self.users end end class Region :has_many :domains :has_many :users, :through => :regional_coordinators def coordinators self.users end end
This paste will be private.
From the Design Piracy series on my blog: