anyone-oslo/pages

View on GitHub
app/models/invite_role.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
# 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