Sha256: 8a87963ef7c96487f734235286a2b1fc927ead34a7e76e619ee7252fdfd208d8

Contents?: true

Size: 350 Bytes

Versions: 91

Compression:

Stored size: 350 Bytes

Contents

class Permission < ActiveRecord::Base
  belongs_to :membership
  belongs_to :project
  belongs_to :user

  before_validation :assign_user_id_from_membership

  def user=(ignored)
    raise NotImplementedError, "Use Permission#membership= instead"
  end

  private

  def assign_user_id_from_membership
    self.user_id = membership.user_id
  end
end

Version data entries

91 entries across 91 versions & 1 rubygems

Version Path
saucy-0.2.36 app/models/permission.rb
saucy-0.2.35 app/models/permission.rb
saucy-0.2.34 app/models/permission.rb
saucy-0.2.33 app/models/permission.rb
saucy-0.2.32 app/models/permission.rb
saucy-0.2.31 app/models/permission.rb
saucy-0.2.30 app/models/permission.rb
saucy-0.2.29 app/models/permission.rb
saucy-0.2.28 app/models/permission.rb
saucy-0.2.27 app/models/permission.rb
saucy-0.2.26 app/models/permission.rb
saucy-0.2.25 app/models/permission.rb
saucy-0.2.24 app/models/permission.rb
saucy-0.2.21 app/models/permission.rb
saucy-0.2.20 app/models/permission.rb
saucy-0.2.18 app/models/permission.rb
saucy-0.2.17 app/models/permission.rb
saucy-0.2.16 app/models/permission.rb
saucy-0.2.15 app/models/permission.rb
saucy-0.2.14 app/models/permission.rb