From 828ce5d227aafac95047bff99dfe49436a425a35 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 28 Apr 2011 07:10:13 +0000 Subject: [PATCH] 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 --- lib/tasks/extract_fixtures.rake | 16 +++++++--------- 1 file 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 -- 2.39.5