Files
danbooru/app/models
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
..
2017-02-28 16:28:58 -08:00
2017-01-03 15:04:47 -08:00
2016-02-22 17:02:15 -08:00
2015-08-18 17:40:53 -07:00
2014-04-16 17:43:34 -07:00
2017-01-03 15:04:47 -08:00
2014-04-16 17:43:34 -07:00
2017-01-03 15:04:47 -08:00
2017-03-21 13:56:48 -07:00
2017-02-21 13:40:52 -08:00
2016-09-25 14:56:19 -07:00
2017-03-15 16:08:47 -07:00
2017-01-17 15:46:21 -08:00
2015-08-18 17:40:53 -07:00