Created
May 30, 2013 21:43
-
-
Save warmwaffles/5681500 to your computer and use it in GitHub Desktop.
This file contains 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
p = lambda do | |
{:default => <<-DEFAULT_SQL, :mysql => <<-MYSQL} | |
UPDATE users SET item_count = item_count + 1 | |
WHERE id IN (SELECT user_id FROM buckets WHERE id = NEW.bucket_id) | |
DEFAULT_SQL | |
UPDATE users, buckets SET item_count = item_count + 1 | |
WHERE users.id = user_id AND buckets.id = NEW.bucket_id | |
MYSQL | |
end | |
p.call |
Author
warmwaffles
commented
May 19, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment