Created
August 5, 2010 20:14
-
-
Save jish/510307 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
require 'pp' | |
class Base | |
def self.update_all(one, two = nil, three = {}) | |
puts "one:" | |
pp one | |
puts "two:" | |
pp two | |
puts "three:" | |
pp three | |
end | |
end | |
Base.update_all :foo => "foo", :bar => "bar" | |
puts | |
Base.update_all({ :foo => "foo" }, { :bar => "bar" }) | |
# one: | |
# {:bar=>"bar", :foo=>"foo"} | |
# two: | |
# nil | |
# three: | |
# {} | |
# | |
# one: | |
# {:foo=>"foo"} | |
# two: | |
# {:bar=>"bar"} | |
# three: | |
# {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment