Class: Volt::User
Instance Attribute Summary
Attributes inherited from Model
#attributes, #options, #parent, #path, #persistor
Class Method Summary collapse
-
.login_field ⇒ Object
returns true if the user configured using the username.
Instance Method Summary collapse
Methods inherited from Model
#!, #<<, #==, #_id, #_id=, #assign_attribute, #expand!, #initialize, #inspect, #method_missing, #new_array_model, #new_model, nosave, #read_attribute, #read_new_model
Methods included from Buffer
#buffer, #promise_for_errors, #save!
Methods included from ModelState
#change_state_to, #loaded?, #state
Methods included from Validations
#clear_server_errors, #errors, included, #mark_all_fields!, #mark_field!, #marked_errors, #marked_fields, #server_errors
Methods included from ModelHashBehaviour
#clear, #delete, #each, #each_pair, #each_with_object, #empty?, #false?, #key?, #keys, #nil?, #size, #to_h, #true?
Methods included from ModelHelpers
#class_at_path, #deep_unwrap, #event_added, #event_removed
Methods included from ModelWrapper
Constructor Details
This class inherits a constructor from Volt::Model
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Volt::Model
Class Method Details
.login_field ⇒ Object
returns true if the user configured using the username
6 7 8 9 10 11 12 |
# File 'app/volt/models/user.rb', line 6 def self.login_field if Volt.config.public.try(:auth).try(:use_username) :username else :email end end |
Instance Method Details
#password=(val) ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'app/volt/models/user.rb', line 21 def password=(val) if Volt.server? # on the server, we bcrypt the password and store the result self._hashed_password = BCrypt::Password.create(val) else self._password = val end end |