Class: Nightlight::Activity

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/nightlight/activity.rb

Instance Method Summary collapse

Instance Method Details

#checked?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/models/nightlight/activity.rb', line 24

def checked?
  name=='checked'
end

#status?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'app/models/nightlight/activity.rb', line 21

def status?
  name=='status'
end

#to_sObject



13
14
15
# File 'app/models/nightlight/activity.rb', line 13

def to_s
  "#{user_name} #{verb_phrase}".humanize
end

#user_nameObject



17
18
19
# File 'app/models/nightlight/activity.rb', line 17

def user_name
  user.try(:name) || 'someone'
end