Module: Contourable
- Extended by:
- ActiveSupport::Concern
- Defined in:
- app/models/concerns/contourable.rb
Instance Method Summary collapse
Instance Method Details
#apply_omniauth(omniauth) ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/models/concerns/contourable.rb', line 8 def apply_omniauth(omniauth) unless omniauth['info'].blank? self.email = omniauth['info']['email'] if email.blank? end self.password = Devise.friendly_token[0,20] if self.password.blank? authentications.build( provider: omniauth['provider'], uid: omniauth['uid'] ) end |
#password_required? ⇒ Boolean
16 17 18 |
# File 'app/models/concerns/contourable.rb', line 16 def password_required? (authentications.empty? || !password.blank?) && super end |