Module: Tomify::Concerns::User

Extended by:
ActiveSupport::Concern
Included in:
User
Defined in:
app/models/tomify/concerns/user.rb

Instance Method Summary collapse

Instance Method Details

#nameObject



24
25
26
# File 'app/models/tomify/concerns/user.rb', line 24

def name
  "#{first_name} #{last_name}"
end

#subscriptionObject



28
29
30
# File 'app/models/tomify/concerns/user.rb', line 28

def subscription
  Tomify.models.subscription.find_or_create_by(email: email)
end

#token(name = nil) ⇒ Object



32
33
34
# File 'app/models/tomify/concerns/user.rb', line 32

def token(name = nil)
  tokens.find_or_create_by(name: name)
end