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