Skip to content

Commit

Permalink
assume Task#views may be nil
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Mar 19, 2008
1 parent 58073ce commit f32dc8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/models/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ def version
end

def add_view
increment! :views
update_attributes(:views => views.to_i + 1)
end

def views
self[:views].to_i
end

def approve
Expand Down

0 comments on commit f32dc8d

Please sign in to comment.