im very very stuck trying to figure out how to go about implementing a
sum method to sum up the points a user gained for each day of the
create_table “user_point_logs”, :force => true do |t|
t.column “user_id”, :integer
t.column “points”, :integer
t.column “created_at”, :datetime
I want to be about to simply calculate the total points the user
gained for the last seven days.
I got this so far.
@statistics = @current_user.user_point_logs.find(:all,
:conditions => [‘created_at > ?’, 7.days.ago])
can any provided me some snippets to help me out?