Skip to content

Instantly share code, notes, and snippets.

@jish
Created August 5, 2010 20:14
Show Gist options
  • Save jish/510307 to your computer and use it in GitHub Desktop.
Save jish/510307 to your computer and use it in GitHub Desktop.
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