merit-gem / merit

Reputation engine for Rails apps
Other
1.53k stars 198 forks source link

subtract_points is not working #353

Closed scottcmerritt closed 4 years ago

scottcmerritt commented 4 years ago

User.all.each do |user| user.subtract_points(10, category: "my-category")
user.add_points(-10, category: "my-category") end

Neither method is doing anything. Any thoughts on what I might not be doing right?

Update: the built in per user points query is working AND the points are in fact being removed.

To clarify what I was trying to do...I was building an aggregate function to make a list of point...and there was a bug in the aggregate query.

tute commented 4 years ago

Please paste the logs that those calls generate, and the contents of your merit rules files, so we can dig in deeper. Thanks!

scottcmerritt commented 4 years ago

Update:

scottcmerritt commented 4 years ago

I updated the issue. The bug was in an aggregate query I wrote, not the core gem methods.

Thanks for your quick reply :)