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.13 app/models/permission.rb
saucy-0.2.12 app/models/permission.rb
saucy-0.2.11 app/models/permission.rb
saucy-0.2.10 app/models/permission.rb
saucy-0.2.9 app/models/permission.rb
saucy-0.2.8.1 app/models/permission.rb
saucy-0.2.8 app/models/permission.rb
saucy-0.2.7 app/models/permission.rb
saucy-0.2.6.1 app/models/permission.rb
saucy-0.2.6 app/models/permission.rb
saucy-0.2.5 app/models/permission.rb
saucy-0.2.4.1 app/models/permission.rb
saucy-0.2.4 app/models/permission.rb
saucy-0.2.3 app/models/permission.rb
saucy-0.2.2 app/models/permission.rb
saucy-0.2.1 app/models/permission.rb
saucy-0.2.0 app/models/permission.rb
saucy-0.1.18 app/models/permission.rb
saucy-0.1.17 app/models/permission.rb
saucy-0.1.16 app/models/permission.rb