Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong number of arguments in new_column override method #299

Open
jondh opened this issue Mar 6, 2019 · 0 comments
Open

wrong number of arguments in new_column override method #299

jondh opened this issue Mar 6, 2019 · 0 comments

Comments

@jondh
Copy link

jondh commented Mar 6, 2019

Rails Version: 4.2.11
activerecord-postgis-adapter version: 3.1.5
(similar to #276)

The override of new_column does not match the rails definition. The rails commit causing this mismatch was made here.

Steps to reproduce

  1. create an attribute in an active record model that is not in your schema (e.g. attribute :test_integer, :integer)
  2. perform a migration on your database (may need to drop and create db if no new migrations)

resulting error stacktrace ( Link to rails attributes new_column call )

ArgumentError: wrong number of arguments (given 3, expected 4..7)
/var/lib/gems/2.3.0/gems/activerecord-postgis-adapter-3.1.5/lib/active_record/connection_adapters/postgis/schema_statements.rb:19:in `new_column'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attributes.rb:124:in `block in add_user_provided_columns'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attributes.rb:123:in `each'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attributes.rb:123:in `map'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attributes.rb:123:in `add_user_provided_columns'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attribute_decorators.rb:28:in `add_user_provided_columns'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attributes.rb:93:in `columns'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/attributes.rb:98:in `columns_hash'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/sanitization.rb:109:in `block in sanitize_sql_hash_for_assignment'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/sanitization.rb:108:in `each'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/sanitization.rb:108:in `map'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/sanitization.rb:108:in `sanitize_sql_hash_for_assignment'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/sanitization.rb:40:in `sanitize_sql_for_assignment'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/relation.rb:332:in `update_all'
/opt/pushd-web/db/migrate/20150512195355_add_handling_to_assets.rb:9:in `change'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:608:in `exec_migration'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:592:in `block (2 levels) in migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:591:in `block in migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:590:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:768:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:1023:in `block in execute_migration_in_transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:1069:in `block in ddl_transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/connection_adapters/abstract/transaction.rb:184:in `within_new_transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/transactions.rb:220:in `transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:1069:in `ddl_transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:1022:in `execute_migration_in_transaction'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:984:in `block in migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:980:in `each'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:980:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:823:in `up'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/migration.rb:801:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/tasks/database_tasks.rb:139:in `migrate'
/var/lib/gems/2.3.0/gems/activerecord-4.2.11/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.3.0/gems/airbrake-6.2.0/lib/airbrake/rake.rb:19:in `execute'
/var/lib/gems/2.3.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants