Created
June 18, 2009 20:12
-
-
Save alexrothenberg/132164 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
def to_factory model | |
model.columns.each do |c| | |
if c.null == false | |
value = case c.type | |
when :integer | |
"7" | |
when :string | |
"'hi'" | |
when :boolean | |
'false' | |
when :date | |
'{Time.now}' | |
when :datetime | |
'{Time.now}' | |
else | |
raise "forgot about #{c.type}" | |
end | |
puts "#{c.name.first}.#{c.name} #{value}" | |
end | |
end | |
true | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment