Sha256: 034812576765742b985c28ed63823724e8245367e998bea91f10935de26d97e9

Contents?: true

Size: 286 Bytes

Versions: 29

Compression:

Stored size: 286 Bytes

Contents

# frozen_string_literal: true

class InviteRole < ApplicationRecord
  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

29 entries across 29 versions & 1 rubygems

Version Path
pages_core-3.15.5 app/models/invite_role.rb
pages_core-3.15.4 app/models/invite_role.rb
pages_core-3.15.3 app/models/invite_role.rb
pages_core-3.15.2 app/models/invite_role.rb
pages_core-3.15.1 app/models/invite_role.rb
pages_core-3.14.0 app/models/invite_role.rb
pages_core-3.13.0 app/models/invite_role.rb
pages_core-3.12.7 app/models/invite_role.rb
pages_core-3.12.6 app/models/invite_role.rb
pages_core-3.12.5 app/models/invite_role.rb
pages_core-3.12.4 app/models/invite_role.rb
pages_core-3.12.3 app/models/invite_role.rb
pages_core-3.12.2 app/models/invite_role.rb
pages_core-3.12.1 app/models/invite_role.rb
pages_core-3.12.0 app/models/invite_role.rb
pages_core-3.11.3 app/models/invite_role.rb
pages_core-3.11.2 app/models/invite_role.rb
pages_core-3.11.1 app/models/invite_role.rb
pages_core-3.11.0 app/models/invite_role.rb
pages_core-3.10.2 app/models/invite_role.rb