Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit ce5827ea4791e8b8143919ecceb0231e36e8932e 1 parent 8d2f6c1
Pratik lifo authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 activerecord/lib/active_record/schema_dumper.rb
4 activerecord/lib/active_record/schema_dumper.rb
View
@@ -177,7 +177,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.