Sha256: 22339144478b5c0d390ebbaf2040d4adc72447540943fd8354631b7cbe47edec

Contents?: true

Size: 317 Bytes

Versions: 33

Compression:

Stored size: 317 Bytes

Contents

class Tramway::User::User < ::Tramway::Core::ApplicationRecord
  has_secure_password #FIXME remove repeating from tramway-user

  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

33 entries across 33 versions & 1 rubygems

Version Path
tramway-admin-1.18.0.1 app/models/tramway/user/user.rb
tramway-admin-1.18 app/models/tramway/user/user.rb
tramway-admin-1.17.0.1 app/models/tramway/user/user.rb
tramway-admin-1.17 app/models/tramway/user/user.rb
tramway-admin-1.16.1.1 app/models/tramway/user/user.rb
tramway-admin-1.16.1 app/models/tramway/user/user.rb
tramway-admin-1.16.0.2 app/models/tramway/user/user.rb
tramway-admin-1.16.0.1 app/models/tramway/user/user.rb
tramway-admin-1.16 app/models/tramway/user/user.rb
tramway-admin-1.15 app/models/tramway/user/user.rb
tramway-admin-1.14.1 app/models/tramway/user/user.rb
tramway-admin-1.14.0.3 app/models/tramway/user/user.rb
tramway-admin-1.14.0.2 app/models/tramway/user/user.rb
tramway-admin-1.14.0.1 app/models/tramway/user/user.rb
tramway-admin-1.14 app/models/tramway/user/user.rb
tramway-admin-1.13.0.4 app/models/tramway/user/user.rb
tramway-admin-1.13.0.3 app/models/tramway/user/user.rb
tramway-admin-1.13.0.2 app/models/tramway/user/user.rb
tramway-admin-1.13.0.1 app/models/tramway/user/user.rb
tramway-admin-1.13 app/models/tramway/user/user.rb