Sha256: d45ea6794eec25019c31d77b7a4290a229638b1cd55861202a698f433d6e03bb

Contents?: true

Size: 303 Bytes

Versions: 82

Compression:

Stored size: 303 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, case_sensitive: true

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

Version data entries

82 entries across 82 versions & 1 rubygems

Version Path
solidus_core-4.3.4 app/models/spree/role.rb
solidus_core-4.2.4 app/models/spree/role.rb
solidus_core-4.1.5 app/models/spree/role.rb
solidus_core-4.3.3 app/models/spree/role.rb
solidus_core-4.3.2 app/models/spree/role.rb
solidus_core-4.1.4 app/models/spree/role.rb
solidus_core-4.3.1 app/models/spree/role.rb
solidus_core-4.3.0 app/models/spree/role.rb
solidus_core-4.2.3 app/models/spree/role.rb
solidus_core-4.1.3 app/models/spree/role.rb
solidus_core-4.0.4 app/models/spree/role.rb
solidus_core-3.4.6 app/models/spree/role.rb
solidus_core-4.0.3 app/models/spree/role.rb
solidus_core-4.1.2 app/models/spree/role.rb
solidus_core-4.2.2 app/models/spree/role.rb
solidus_core-3.4.5 app/models/spree/role.rb
solidus_core-4.2.1 app/models/spree/role.rb
solidus_core-4.2.0 app/models/spree/role.rb
solidus_core-4.1.1 app/models/spree/role.rb
solidus_core-4.0.2 app/models/spree/role.rb