Skip to content

Instantly share code, notes, and snippets.

@jamster
Created December 19, 2008 21:53
Show Gist options
  • Save jamster/38147 to your computer and use it in GitHub Desktop.
Save jamster/38147 to your computer and use it in GitHub Desktop.
# Deomontrates (very simply) how Active Record handles multiparameter assignments
require "rubygems"
require "activesupport"
require "activerecord"
this_hash = {
"date(3i)" => "20",
"date(2i)" => "1",
"date(1i)" => "2003"
}
gets_turned_into_this_array = [2003,1,20]
# And splatted in here
date = Date.new(*gets_turned_into_this_array)
puts date.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment