Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b1b4e26a89
Fetching contributors…

Cannot retrieve contributors at this time

18 lines (14 sloc) 0.34 kb
class Ownership < ActiveRecord::Base
belongs_to :rubygem
belongs_to :user
validates :user_id, :uniqueness => {:scope => :rubygem_id}
before_destroy :keep_last_owner
def keep_last_owner
if rubygem.owners.count == 1
errors[:base] << "Can't delete last owner of a gem."
false
else
true
end
end
end
Jump to Line
Something went wrong with that request. Please try again.