Class: Bolt::User
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Bolt::User
- Defined in:
- app/models/bolt/user.rb
Instance Attribute Summary collapse
-
#notify_of_new_password ⇒ Object
Returns the value of attribute notify_of_new_password.
Class Method Summary collapse
Instance Method Summary collapse
- #check_time_zone ⇒ Object
- #is_admin? ⇒ Boolean
- #send_create_notification ⇒ Object
- #send_password_reset_instructions ⇒ Object
- #send_update_notification ⇒ Object
Instance Attribute Details
#notify_of_new_password ⇒ Object
Returns the value of attribute notify_of_new_password.
24 25 26 |
# File 'app/models/bolt/user.rb', line 24 def notify_of_new_password @notify_of_new_password end |
Class Method Details
.has_more_than_one_admin ⇒ Object
27 28 29 |
# File 'app/models/bolt/user.rb', line 27 def self.has_more_than_one_admin Bolt::User.where(:access_level => $BOLT_USER_ACCESS_LEVEL_ADMIN).count > 1 end |
.table_name ⇒ Object
12 13 14 |
# File 'app/models/bolt/user.rb', line 12 def self.table_name self.to_s.gsub("::", "_").tableize end |
Instance Method Details
#check_time_zone ⇒ Object
47 48 49 |
# File 'app/models/bolt/user.rb', line 47 def check_time_zone self.time_zone = Rails.configuration.time_zone unless self.time_zone end |
#is_admin? ⇒ Boolean
51 52 53 |
# File 'app/models/bolt/user.rb', line 51 def is_admin? users_groups.include?(Group.first) end |
#send_create_notification ⇒ Object
31 32 33 |
# File 'app/models/bolt/user.rb', line 31 def send_create_notification Bolt::BoltNotification.new_user_information(bolt_config_email_from_address, self, bolt_config_hostname, @password).deliver end |
#send_password_reset_instructions ⇒ Object
42 43 44 45 |
# File 'app/models/bolt/user.rb', line 42 def send_password_reset_instructions reset_perishable_token! Bolt::BoltNotification.password_reset_instructions(bolt_config_email_from_address, self, bolt_config_hostname).deliver end |
#send_update_notification ⇒ Object
35 36 37 38 39 40 |
# File 'app/models/bolt/user.rb', line 35 def send_update_notification if notify_of_new_password notify_of_new_password = false Bolt::BoltNotification.generate_new_password(bolt_config_email_from_address, self, bolt_config_hostname, @password).deliver end end |