Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make sure schema dumper doesnt throw up when there are no index lengths

  • Loading branch information...
commit 3c1bb40b6b0b611ba068c2e5375cbcc400c40507 1 parent 77adb4b
@lifo lifo authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/schema_dumper.rb
View
4 activerecord/lib/active_record/schema_dumper.rb
@@ -170,7 +170,9 @@ def indexes(table, stream)
statment_parts << index.columns.inspect
statment_parts << (':name => ' + index.name.inspect)
statment_parts << ':unique => true' if index.unique
- statment_parts << (':length => ' + Hash[*index.columns.zip(index.lengths).flatten].inspect) if index.lengths.compact.present?
+
+ index_lengths = index.lengths.compact if index.lengths.is_a?(Array)
+ statment_parts << (':length => ' + Hash[*index.columns.zip(index.lengths).flatten].inspect) if index_lengths.present?
' ' + statment_parts.join(', ')
end
Please sign in to comment.
Something went wrong with that request. Please try again.