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

IndexDefinition overload breaks constructor in rails 3.0.10 #31

Description

@jconley

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions