Class: Adminpanel::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Adminpanel::User
- Includes:
- Base
- Defined in:
- app/models/adminpanel/user.rb
Constant Summary collapse
- VALID_EMAIL_REGEX =
/\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
Class Method Summary collapse
- .digest(token) ⇒ Object
- .display_name ⇒ Object
- .form_attributes ⇒ Object
- .icon ⇒ Object
- .new_remember_token ⇒ Object
Methods included from Base
#correlative_order_gallery, #destroy_unattached_images
Class Method Details
.digest(token) ⇒ Object
81 82 83 |
# File 'app/models/adminpanel/user.rb', line 81 def self.digest(token) Digest::SHA1.hexdigest(token.to_s) end |
.display_name ⇒ Object
85 86 87 |
# File 'app/models/adminpanel/user.rb', line 85 def self.display_name I18n.t('model.User') end |
.form_attributes ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'app/models/adminpanel/user.rb', line 35 def self.form_attributes [ { 'name' => { 'type' => 'text_field', 'label' => 'Nombre', 'placeholder' => 'Nombre' } }, { 'email' => { 'type' => 'email_field', 'label' => 'Correo', 'placeholder' => 'Correo' } }, { 'password' => { 'type' => 'password_field', 'label' => I18n.t('model.attributes.password'), 'placeholder' => I18n.t('model.attributes.password'), 'show' => 'false' } }, { 'password_confirmation' => { 'type' => 'password_field', 'placeholder' => I18n.t('model.attributes.password_confirmation'), 'label' => I18n.t('model.attributes.password_confirmation'), 'show' => 'false' } }, { 'role_id' => { 'type' => 'select', 'options' => Proc.new { |user| Role.all }, 'label' => I18n.t('model.attributes.role_id') } }, ] end |
.icon ⇒ Object
89 90 91 |
# File 'app/models/adminpanel/user.rb', line 89 def self.icon 'user' end |
.new_remember_token ⇒ Object
77 78 79 |
# File 'app/models/adminpanel/user.rb', line 77 def self.new_remember_token SecureRandom.urlsafe_base64 end |