Sha256: 5a626552fb379fe19288028fdb365974cdec7b0e3a86201210fde985ede93dff

Contents?: true

Size: 259 Bytes

Versions: 6

Compression:

Stored size: 259 Bytes

Contents

class InviteRole < ActiveRecord::Base
  belongs_to :invite
  validates :name,
            presence:   true,
            uniqueness: { scope: :invite_id },
            inclusion:  { in: proc { Role.roles.map(&:name) } }

  def to_s
    name.humanize
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pages_core-3.6.2 app/models/invite_role.rb
pages_core-3.6.1 app/models/invite_role.rb
pages_core-3.6.0 app/models/invite_role.rb
pages_core-3.4.3 app/models/invite_role.rb
pages_core-3.5.1 app/models/invite_role.rb
pages_core-3.4.2 app/models/invite_role.rb