diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-03 15:35:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-03 15:35:56 -0700 |
commit | 5154a464cc405438336739ba0d563f87d9fc2d96 (patch) | |
tree | 7e343d7d72d8141cc435aa496bea7840f7ae1e06 /activerecord/lib | |
parent | 7836616a6473527f1f42672e54cf6971c05f6fdf (diff) | |
download | rails-5154a464cc405438336739ba0d563f87d9fc2d96.tar.gz rails-5154a464cc405438336739ba0d563f87d9fc2d96.tar.bz2 rails-5154a464cc405438336739ba0d563f87d9fc2d96.zip |
lengths will be nil or an array
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/schema_dumper.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/schema_dumper.rb b/activerecord/lib/active_record/schema_dumper.rb index 437f01b657..f5331bb8a9 100644 --- a/activerecord/lib/active_record/schema_dumper.rb +++ b/activerecord/lib/active_record/schema_dumper.rb @@ -183,8 +183,8 @@ HEADER ] statement_parts << ':unique => true' if index.unique - index_lengths = index.lengths.compact if index.lengths.is_a?(Array) - statement_parts << (':length => ' + Hash[*index.columns.zip(index.lengths).flatten].inspect) if index_lengths.present? + index_lengths = (index.lengths || []).compact + statement_parts << (':length => ' + Hash[index.columns.zip(index.lengths)].inspect) unless index_lengths.empty? ' ' + statement_parts.join(', ') end |