Class: User
- Inherits:
-
Object
- Object
- User
- Includes:
- ActiveModel::ForbiddenAttributesProtection, Concerns::AdminMixin, Concerns::InterproMixin, Concerns::ProducerMixin, Concerns::WinewooUserMixin, Mongoid::Document, Mongoid::Search, Mongoid::Timestamps
- Defined in:
- app/models/user.rb
Overview
Instance Method Summary collapse
-
#admin? ⇒ Boolean
Methods.
-
#email ⇒ Object
Database authenticatable.
-
#encrypted_password ⇒ Object
Validations.
- #interpro? ⇒ Boolean
-
#name ⇒ Object
Initialize search engine.
- #producer? ⇒ Boolean
-
#remember_created_at ⇒ Object
Rememberable.
-
#reset_password_token ⇒ Object
Recoverable.
-
#sign_in_count ⇒ Object
Trackable.
-
#updated ⇒ Object
Personal informations.
- #winewoo_user? ⇒ Boolean
Methods included from Concerns::WinewooUserMixin
#add_wine_to_history, #authenticated?, #guest?, #save_for_interpro, #save_for_producer, send_reset_password_instructions
Methods included from Concerns::InterproMixin
Methods included from Concerns::ProducerMixin
Instance Method Details
#admin? ⇒ Boolean
Methods
84 85 86 |
# File 'app/models/user.rb', line 84 def admin? (self.user_roles & [:admin, "admin"]).any? end |
#email ⇒ Object
Database authenticatable
24 |
# File 'app/models/user.rb', line 24 field :email, type: String |
#encrypted_password ⇒ Object
Validations
70 |
# File 'app/models/user.rb', line 70 validates_presence_of :encrypted_password |
#interpro? ⇒ Boolean
88 89 90 |
# File 'app/models/user.rb', line 88 def interpro? (self.user_roles & [:interpro, "interpro"]).any? end |
#name ⇒ Object
Initialize search engine
28 |
# File 'app/models/user.rb', line 28 field :name, type: String |
#producer? ⇒ Boolean
92 93 94 |
# File 'app/models/user.rb', line 92 def producer? (self.user_roles & [:producer, "producer"]).any? end |
#remember_created_at ⇒ Object
Rememberable
35 |
# File 'app/models/user.rb', line 35 field :remember_created_at, type: Time |
#reset_password_token ⇒ Object
Recoverable
31 |
# File 'app/models/user.rb', line 31 field :reset_password_token, type: String |
#sign_in_count ⇒ Object
Trackable
38 |
# File 'app/models/user.rb', line 38 field :sign_in_count, type: Integer, default: 0 |
#updated ⇒ Object
Personal informations
56 |
# File 'app/models/user.rb', line 56 field :updated, type: Boolean |
#winewoo_user? ⇒ Boolean
96 97 98 |
# File 'app/models/user.rb', line 96 def winewoo_user? (self.user_roles & [:winewoo_user, "winewoo_user"]).any? end |