Add spanish locales and gravatar options
This commit is contained in:
@@ -19,7 +19,10 @@ class Employee
|
||||
end
|
||||
|
||||
#view :by_confirmation_token, key: :confirmation_token # devise confirmable
|
||||
devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #, :registerable #, :confirmable
|
||||
devise_plugins = [:database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable, :trackable] #, :omniauthable, {omniauth_providers: [:facebook, :instagram]}] #, :token_authenticatable , :registerable
|
||||
devise_plugins -= [:trackable] if Rails.env.test? # creates conflicts
|
||||
devise *devise_plugins
|
||||
# devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable #, :registerable #, :confirmable
|
||||
property :unconfirmed_email
|
||||
|
||||
property :name
|
||||
|
||||
@@ -219,7 +219,7 @@ class Supplier
|
||||
private
|
||||
|
||||
def add_section_on_create
|
||||
@section = Section.create supplier: self, title: I18n.t('supplier.section.first_section_title')
|
||||
@section = Section.create supplier: self, title: I18n.t('supplier.section.first_section_title', default: nil) || 'Room'
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ class User
|
||||
property :name
|
||||
property :active_list_id
|
||||
property :admin, type: :boolean, default: false
|
||||
property :email_sha256
|
||||
|
||||
#FACEBOOK
|
||||
property :provider
|
||||
@@ -26,6 +27,7 @@ class User
|
||||
|
||||
validates_uniqueness_of :email
|
||||
before_save :ensure_authentication_token
|
||||
before_create :set_email_sha256
|
||||
|
||||
#has_many :error_logs
|
||||
has_many :user_feedbacks
|
||||
@@ -150,6 +152,10 @@ class User
|
||||
reset_authentication_token! if authentication_token.blank?
|
||||
end
|
||||
|
||||
def set_email_sha256
|
||||
self.email_sha256 = Digest::SHA256.hexdigest email.to_s.strip.downcase
|
||||
end
|
||||
|
||||
def self.authentication_token
|
||||
SecureRandom.hex(24)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user