aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-04 16:14:41 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-04 16:14:41 -0800
commit1b276d53fb15a42025d5eeaca1bcd1b837a5dc53 (patch)
tree5abebb12a4195ab242438a2cf96088da63f2042d /activerecord
parent8e051a180e3d740cdb8e2390ef2f1c0d7b08c956 (diff)
downloadrails-1b276d53fb15a42025d5eeaca1bcd1b837a5dc53.tar.gz
rails-1b276d53fb15a42025d5eeaca1bcd1b837a5dc53.tar.bz2
rails-1b276d53fb15a42025d5eeaca1bcd1b837a5dc53.zip
fix some formatting
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/schema_dumper.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb
index 3cdbaf8b7b..f189a6a688 100644
--- a/activerecord/lib/active_record/schema_dumper.rb
+++ b/activerecord/lib/active_record/schema_dumper.rb
@@ -127,10 +127,14 @@ HEADER
end.compact
# find all migration keys used in this table
- keys = [:name, :limit, :precision, :scale, :default, :null] & column_specs.map{ |k| k.keys }.flatten
+ keys = [:name, :limit, :precision, :scale, :default, :null] & column_specs.map(&:keys).flatten
# figure out the lengths for each column based on above keys
- lengths = keys.map{ |key| column_specs.map{ |spec| spec[key] ? spec[key].length + 2 : 0 }.max }
+ lengths = keys.map { |key|
+ column_specs.map { |spec|
+ spec[key] ? spec[key].length + 2 : 0
+ }.max
+ }
# the string we're going to sprintf our values against, with standardized column widths
format_string = lengths.map{ |len| "%-#{len}s" }