Sha256: 4c22e51e2a04cb733553405218ff6a9743868a3043d249f4a16dde331fdff891
Contents?: true
Size: 475 Bytes
Versions: 7
Compression:
Stored size: 475 Bytes
Contents
module PandaCms class User < ApplicationRecord validates :firstname, presence: true validates :lastname, presence: true validates :email, presence: true, uniqueness: {case_sensitive: true} def is_admin? admin end def name "#{firstname} #{lastname}" end 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 end end
Version data entries
7 entries across 7 versions & 1 rubygems