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.8.1 app/models/permission.rb
saucy-0.8.0 app/models/permission.rb
saucy-0.7.3 app/models/permission.rb
saucy-0.7.2 app/models/permission.rb
saucy-0.7.1 app/models/permission.rb
saucy-0.7.0 app/models/permission.rb
saucy-0.6.1 app/models/permission.rb
saucy-0.6.0 app/models/permission.rb
saucy-0.5.5 app/models/permission.rb
saucy-0.5.4 app/models/permission.rb
saucy-0.5.3 app/models/permission.rb
saucy-0.5.2 app/models/permission.rb
saucy-0.5.1 app/models/permission.rb
saucy-0.5.0 app/models/permission.rb
saucy-0.4.10 app/models/permission.rb
saucy-0.4.9 app/models/permission.rb
saucy-0.2.28.1 app/models/permission.rb
saucy-0.4.8 app/models/permission.rb
saucy-0.4.7 app/models/permission.rb
saucy-0.4.6 app/models/permission.rb