Sha256: 7dcf8f9cdfdf4fbce938bbedfa68790e94b82e2b39d0edb2dd6e3b4047bdfb03

Contents?: true

Size: 308 Bytes

Versions: 60

Compression:

Stored size: 308 Bytes

Contents

# frozen_string_literal: true

module Ibrain
  class Role < Ibrain::Base
    has_many :role_users, class_name: "Ibrain::RoleUser", dependent: :destroy
    has_many :users, through: :role_users

    validates :name, uniqueness: { case_sensitive: true }

    def admin?
      name == "admin"
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
ibrain-core-0.4.2 app/models/ibrain/role.rb
ibrain-core-0.4.1 app/models/ibrain/role.rb
ibrain-core-0.4.0 app/models/ibrain/role.rb
ibrain-core-0.3.9 app/models/ibrain/role.rb
ibrain-core-0.3.8 app/models/ibrain/role.rb
ibrain-core-0.3.7.rc.pre.1 app/models/ibrain/role.rb
ibrain-core-0.3.7 app/models/ibrain/role.rb
ibrain-core-0.3.6.pre.rc.1 app/models/ibrain/role.rb
ibrain-core-0.3.6 app/models/ibrain/role.rb
ibrain-core-0.3.5 app/models/ibrain/role.rb
ibrain-core-0.3.4 app/models/ibrain/role.rb
ibrain-core-0.3.3.pre.rc.2 app/models/ibrain/role.rb
ibrain-core-0.3.3.pre.rc.1 app/models/ibrain/role.rb
ibrain-core-0.3.3 app/models/ibrain/role.rb
ibrain-core-0.3.2.pre.rc.4 app/models/ibrain/role.rb
ibrain-core-0.3.2.pre.rc.3 app/models/ibrain/role.rb
ibrain-core-0.3.2.pre.rc app/models/ibrain/role.rb
ibrain-core-0.3.2 app/models/ibrain/role.rb
ibrain-core-0.3.1 app/models/ibrain/role.rb
ibrain-core-0.3.0 app/models/ibrain/role.rb