Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

IndexDefinition overload breaks constructor in rails 3.0.10 #31

Open
jconley opened this issue Dec 8, 2011 · 0 comments
Open

IndexDefinition overload breaks constructor in rails 3.0.10 #31

jconley opened this issue Dec 8, 2011 · 0 comments

Comments

@jconley
Copy link

jconley commented Dec 8, 2011

spatial_adapter/common/schema_definitions.rb overloads ActiveRecord::ConnectionAdapters::IndexDefinition with a new constructor to add a spatial parameter, however fails to preserve the "lengths" parameter.

This can cause a crash in certain db migration scripts using add_index.

Rails 3.0.10
IndexDefinition < Struct.new(:table, :name, :unique, :columns, :lengths)
https://github.com/rails/rails/blob/4f15f392601d4504fab850f3bf659c43f0cb51ec/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb

It appears the lengths attribute was added on May 09, 2010 during the rails 2.3 series
rails/rails@8d2f6c1
Looks like any fix will need to accomodate both constructor signatures given support for AR >=2.2.2

@jconley jconley closed this as completed Dec 8, 2011
@jconley jconley reopened this Dec 8, 2011
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant