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



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

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

#serializable_hash(options = nil) ⇒ Object



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

def serializable_hash(options = nil)
  options = { methods: [:name] } if options.blank?
  super options
end

#tokenObject



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

def token
  tokens.first_or_create
end