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.4.5 app/models/permission.rb
saucy-0.4.4 app/models/permission.rb
saucy-0.4.3 app/models/permission.rb
saucy-0.4.2 app/models/permission.rb
saucy-0.4.1 app/models/permission.rb
saucy-0.3.4.1 app/models/permission.rb
saucy-0.4.0 app/models/permission.rb
saucy-0.3.4 app/models/permission.rb
saucy-0.3.3 app/models/permission.rb
saucy-0.3.2 app/models/permission.rb
saucy-0.3.1 app/models/permission.rb
saucy-0.3.0 app/models/permission.rb
saucy-0.2.45 app/models/permission.rb
saucy-0.2.44 app/models/permission.rb
saucy-0.2.43 app/models/permission.rb
saucy-0.2.42 app/models/permission.rb
saucy-0.2.41 app/models/permission.rb
saucy-0.2.40 app/models/permission.rb
saucy-0.2.39 app/models/permission.rb
saucy-0.2.38 app/models/permission.rb