Created
December 19, 2008 21:53
-
-
Save jamster/38147 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
# 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