Class: User

Inherits:
Object
  • Object
show all
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

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

#has_ecommerce?

Methods included from Concerns::ProducerMixin

#contacted_by!

Instance Method Details

#admin?Boolean

Methods

Returns:

  • (Boolean)


84
85
86
# File 'app/models/user.rb', line 84

def admin?
  (self.user_roles & [:admin, "admin"]).any?
end

#emailObject

Database authenticatable



24
# File 'app/models/user.rb', line 24

field :email,              type: String

#encrypted_passwordObject

Validations



70
# File 'app/models/user.rb', line 70

validates_presence_of :encrypted_password

#interpro?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'app/models/user.rb', line 88

def interpro?
  (self.user_roles & [:interpro, "interpro"]).any?
end

#nameObject

Initialize search engine



28
# File 'app/models/user.rb', line 28

field :name, type: String

#producer?Boolean

Returns:

  • (Boolean)


92
93
94
# File 'app/models/user.rb', line 92

def producer?
  (self.user_roles & [:producer, "producer"]).any?
end

#remember_created_atObject

Rememberable



35
# File 'app/models/user.rb', line 35

field :remember_created_at, type: Time

#reset_password_tokenObject

Recoverable



31
# File 'app/models/user.rb', line 31

field :reset_password_token,   type: String

#sign_in_countObject

Trackable



38
# File 'app/models/user.rb', line 38

field :sign_in_count,      type: Integer, default: 0

#updatedObject

Personal informations



56
# File 'app/models/user.rb', line 56

field :updated, type: Boolean

#winewoo_user?Boolean

Returns:

  • (Boolean)


96
97
98
# File 'app/models/user.rb', line 96

def winewoo_user?
  (self.user_roles & [:winewoo_user, "winewoo_user"]).any?
end