You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2022. It is now read-only.
Something in activerecord-jdbcpostgresql-adapter changed in 1.3.15 or 1.3.16, causing this error when using schema_plus 1.8.x:
ArgumentError:
wrong number of arguments calling `initialize` (7 for 4)
# .../.gem/jruby/1.9.3/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:1164:in `columns'
etc.
due to some sort of conflict caused when including schema_plus's Column module into ActiveRecord's.
I've temporarily removed jruby + postgresql from the build (commit 2a05925). But I'm not likely to have time to chase down the problem any time soon.
Hi!
I figured out this issue.
In activerecord-jdbc <= 1.3.12 initialize method was described in PostgreSQLColumn class.
But in activerecord-jdbc > 1.3.12 initialize method was moved to Arjdbc::ArJdbc::PostgreSQL module.
So, after including SchemaPlus::ConnectionAdapters::PostegreSQLColumn:
for <= 1.3.12 ActiveRecord::ConnectionAdapters::PostgreSQLColumn#initialize will be called from ActiveRecord::ConnectionAdapters::PostgreSQLColumn, because
ruby will search for #initialize method through all ancestors and will find it in ActiveRecord::ConnectionAdapters::PostgreSQLColumn class.
for > 1.3.12 ActiveRecord::ConnectionAdapters::PostgreSQLColumn#initialize will be called from SchemaPlus::ActiveRecord::ConnectionAdapters::PostgreSQLColumn, because
ruby will search for #initialize method through all ancestors and it won`t be able to find it in ActiveRecord::ConnectionAdapters::PostgreSQLColumn and will continue to search in
SchemaPlus::ConnectionAdapters::PostegreSQLColumn ancestor.
SchemaPlus::ConnectionAdapters::PostegreSQLColumn is the next ancestor because this extension was included in the last turn.
The solution is to include SchemaPlus::ActiveRecord::ConnectionAdapters::PostgreSQLColumn after Arjdbc::ArJdbc::PostgreSQL, but I can't understand how to do this.
The solution is to include SchemaPlus::ActiveRecord::ConnectionAdapters::PostgreSQLColumn after Arjdbc::ArJdbc::PostgreSQL, but I can't understand how to do this.
Or maybe include SchemaPlus::ActiveRecord::ConnectionAdapters::PostgreSQLColumn into Arjdbc::ArJdbc::PostgreSQL::Column instead of into ActiveRecord::ConnectionAdapters::PostgreSQLColumn?
Unfortunately I'm not a jruby user, and don't have time to look into this myself; plus I'm mostly maintaining schema_plus 2.0 rather than 1.8 -- but I'm happy to accept a PR if you get it to work!
lfidnl
added a commit
to lfidnl/schema_plus
that referenced
this issue
Jul 25, 2015
Something in activerecord-jdbcpostgresql-adapter changed in 1.3.15 or 1.3.16, causing this error when using schema_plus 1.8.x:
due to some sort of conflict caused when including schema_plus's Column module into ActiveRecord's.
I've temporarily removed jruby + postgresql from the build (commit 2a05925). But I'm not likely to have time to chase down the problem any time soon.
@donv, do you want to look into it?
The text was updated successfully, but these errors were encountered: