Module: Tomify::Concerns::User
- Extended by:
- ActiveSupport::Concern
- Included in:
- User
- Defined in:
- app/models/tomify/concerns/user.rb
Instance Method Summary collapse
- #name ⇒ Object
- #serializable_hash(options = nil) ⇒ Object
- #subscription ⇒ Object
- #token(name = nil) ⇒ Object
Instance Method Details
#name ⇒ Object
33 34 35 |
# File 'app/models/tomify/concerns/user.rb', line 33 def name "#{first_name} #{last_name}" end |
#serializable_hash(options = nil) ⇒ Object
45 46 47 48 |
# File 'app/models/tomify/concerns/user.rb', line 45 def serializable_hash( = nil) = { methods: [:name] } if .blank? super end |
#subscription ⇒ Object
37 38 39 |
# File 'app/models/tomify/concerns/user.rb', line 37 def subscription Tomify.models.subscription.find_or_create_by(email: email) end |
#token(name = nil) ⇒ Object
41 42 43 |
# File 'app/models/tomify/concerns/user.rb', line 41 def token(name = nil) tokens.find_or_create_by(name: name) end |