Created
October 1, 2013 15:43
-
-
Save csaunders/6780502 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[11:28:41] <csaunders> maybe you can leverage increment/decrement? | |
[11:29:09] <csaunders> items = Item.where(query) | |
[11:29:31] <csaunders> value > 0 ? items.increment(value) : items.decrement(value) | |
[11:29:33] <csaunders> ¯\(°_o)/¯ | |
[11:29:57] <csaunders> also I think my syntax is wrong :/ | |
[11:30:09] <csaunders> but those might have an answer | |
[11:31:08] <csaunders> keep in mind, increment/decrement don't fire callbacks… |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment