summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-28 07:10:13 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-04-28 07:10:13 +0000
commit828ce5d227aafac95047bff99dfe49436a425a35 (patch)
tree1923fabee5c2d466186e25543a3d4bd91a819575
parentd5b97d49c610d46651462f8e88618812979b9bce (diff)
downloadredmine-828ce5d227aafac95047bff99dfe49436a425a35.tar.gz
redmine-828ce5d227aafac95047bff99dfe49436a425a35.zip
code clean up lib/tasks/extract_fixtures.rake.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5560 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--lib/tasks/extract_fixtures.rake16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/tasks/extract_fixtures.rake b/lib/tasks/extract_fixtures.rake
index 49834e5ab..604091ba3 100644
--- a/lib/tasks/extract_fixtures.rake
+++ b/lib/tasks/extract_fixtures.rake
@@ -10,15 +10,13 @@ task :extract_fixtures => :environment do
File.open("#{RAILS_ROOT}/#{table_name}.yml", 'w' ) do |file|
data = ActiveRecord::Base.connection.select_all(sql % table_name)
file.write data.inject({}) { |hash, record|
-
- # cast extracted values
- ActiveRecord::Base.connection.columns(table_name).each { |col|
- record[col.name] = col.type_cast(record[col.name]) if record[col.name]
- }
-
- hash["#{table_name}_#{i.succ!}"] = record
- hash
+ # cast extracted values
+ ActiveRecord::Base.connection.columns(table_name).each { |col|
+ record[col.name] = col.type_cast(record[col.name]) if record[col.name]
+ }
+ hash["#{table_name}_#{i.succ!}"] = record
+ hash
}.to_yaml
end
end
-end \ No newline at end of file
+end