Sha256: 2cb4c7debf669cd12d310af0c39cb32efebc7e9abbc8b88f8796cf18c6d7b467

Contents?: true

Size: 310 Bytes

Versions: 4

Compression:

Stored size: 310 Bytes

Contents

class Tramway::User::User < ::Tramway::Core::ApplicationRecord
  has_secure_password

  # FIXME replace to tramway-admin
  enumerize :role, in: [ :user, :admin ], default: :user

  def admin?
    role.admin?
  end

  scope :admins, -> { where role: :admin }
  scope :simple_users, -> { where role: :user }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tramway-user-2.1 app/models/tramway/user/user.rb
tramway-user-2.0.1 app/models/tramway/user/user.rb
tramway-user-2.0 app/models/tramway/user/user.rb
tramway-user-1.1.8 app/models/tramway/user/user.rb