Skip to content

The Owner Problem

qrush edited this page Aug 7, 2010 · 6 revisions

Managing owners for gems sucks right now. Let’s fix it. One important note to remember here: the solution should be extensible for subdomains as well.

How it works now:

Just a simple has_many through system:

class User < ActiveRecord::Base
  has_many :ownerships
  has_many :rubygems, :through => :ownerships
end

class Ownership < ActiveRecord::Base
  belongs_to :user
  belongs_to :rubygem
end

class Rubygem < ActiveRecord::Base
  has_many :owners, :through => :ownerships, :source => :user
  has_many :ownerships
end

Ways of fixing it

Group model

Create a Group model that has_many Users. Essentially acts as an ACL. Possibly promote one user as a “Manager” or “Admin” of the list. Users can then create arbitrary groups for each Rubygem or Subdomain.

Discussion

Feel free to add your thoughts/idea here (or above) —@qrush

Clone this wiki locally