Permalink
Browse files

fix some formatting

  • Loading branch information...
1 parent 8e051a1 commit 1b276d53fb15a42025d5eeaca1bcd1b837a5dc53 @tenderlove tenderlove committed Jan 5, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 activerecord/lib/active_record/schema_dumper.rb
View
8 activerecord/lib/active_record/schema_dumper.rb
@@ -127,10 +127,14 @@ def table(table, stream)
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" }

0 comments on commit 1b276d5

Please sign in to comment.