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

#for_envObject



34
35
36
# File 'app/models/tomify/concerns/user.rb', line 34

def for_env
  as_json(self.class.env_serializable_options)
end

#nameObject



38
39
40
# File 'app/models/tomify/concerns/user.rb', line 38

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

#subscriptionObject



42
43
44
# File 'app/models/tomify/concerns/user.rb', line 42

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

#token(name = nil) ⇒ Object



46
47
48
# File 'app/models/tomify/concerns/user.rb', line 46

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