Skip to content

Commit

Permalink
Nil-safe last_activity_at
Browse files Browse the repository at this point in the history
  • Loading branch information
Mat Brown committed Jul 1, 2009
1 parent daab610 commit 8c40add
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/shouter.rb
Expand Up @@ -43,10 +43,12 @@ module ClassMethods

module InstanceMethods
def last_activity_at
shouter_events.first(
if last_event = shouter_events.first(
:select => 'shouter_events.updated_at',
:order => 'updated_at DESC'
).updated_at
)
last_event.updated_at
end
end
end
end

0 comments on commit 8c40add

Please sign in to comment.