Files
danbooru/test/unit
evazion 3dc854c0c8 post_vote.rb: determine vote magnitude from voter, not CurrentUser.
Bug: when moving favorites, the parent is given an upvote for each gold+
favoriter, but the magnitude of these upvotes was based on the
CurrentUser, rather than the upvoter. This meant that upvotes for
supervoter favorites weren't given correctly.

To fix this, `magnitude` is changed to use the voting `user` instead of
CurrentUser.

New problem: when setting the score, `score=` calls `magnitude`, but
`user` isn't initialized yet. So we also refactor so that

    1. `initialize_attributes` initializes `user` before setting `score`
    2. the vote direction is given by `vote`, so it's separate from `score`
    3. updating the score on the post happens in a callback instead of
       directly in `score=`.
2017-03-24 15:43:55 -05:00
..
2015-08-18 17:40:53 -07:00
2014-04-16 17:43:34 -07:00
2017-03-15 16:08:47 -07:00
2016-12-21 11:43:46 -08:00
2014-07-23 15:15:47 -07:00
2014-11-07 15:03:00 -08:00
2016-09-10 10:41:27 +05:00
2015-02-09 19:10:47 -08:00
2016-01-18 17:13:26 -08:00
2017-02-21 13:40:52 -08:00
2014-10-22 17:22:36 -07:00
2016-12-21 11:43:46 -08:00
2017-03-17 12:13:27 -07:00
2013-08-04 17:11:51 -07:00
2017-03-15 16:08:47 -07:00
2017-02-21 13:40:52 -08:00
2013-07-24 18:12:44 -07:00
2017-03-15 16:08:47 -07:00
2014-12-03 14:07:42 -08:00