Sha256: b22a6d4bfd3e6fb35645eb5cab0a3ab3a31ed3e3fd6177255027ef4035f42784

Contents?: true

Size: 281 Bytes

Versions: 48

Compression:

Stored size: 281 Bytes

Contents

# frozen_string_literal: true

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

    validates_uniqueness_of :name

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

Version data entries

48 entries across 48 versions & 2 rubygems

Version Path
solidus_core-2.10.5 app/models/spree/role.rb
solidus_core-2.10.3 app/models/spree/role.rb
solidus_core-2.10.2 app/models/spree/role.rb
solidus_core-2.9.6 app/models/spree/role.rb
solidus_core-2.8.6 app/models/spree/role.rb
solidus_core-2.10.1 app/models/spree/role.rb
solidus_core-2.9.5 app/models/spree/role.rb
solidus_core-2.10.0 app/models/spree/role.rb
solidus_core-2.9.4 app/models/spree/role.rb
solidus_core-2.6.6 app/models/spree/role.rb
solidus_core-2.7.4 app/models/spree/role.rb
solidus_core-2.8.5 app/models/spree/role.rb
solidus_core-2.9.3 app/models/spree/role.rb
solidus_core-2.9.2 app/models/spree/role.rb
solidus_core-2.10.0.beta1 app/models/spree/role.rb
solidus_core-2.7.3 app/models/spree/role.rb
solidus_core-2.6.5 app/models/spree/role.rb
solidus_core-2.9.1 app/models/spree/role.rb
solidus_core-2.9.0 app/models/spree/role.rb
solidus_core-2.9.0.rc.1 app/models/spree/role.rb