Class: PandaCms::User

Inherits:
ApplicationRecord show all
Defined in:
app/models/panda_cms/user.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for_select_list(scope = :all, order = {firstname: :asc, lastname: :asc}) ⇒ Object



17
18
19
# File 'app/models/panda_cms/user.rb', line 17

def self.for_select_list(scope = :all, order = {firstname: :asc, lastname: :asc})
  PandaCms::User.send(scope).order(order).map { |u| [u.name, u.id] }
end

Instance Method Details

#is_admin?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/models/panda_cms/user.rb', line 9

def is_admin?
  admin
end

#nameObject



13
14
15
# File 'app/models/panda_cms/user.rb', line 13

def name
  "#{firstname} #{lastname}"
end