Open ronen opened 9 years ago
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.
@lfidnl thanks for tracking that down.
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!
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 2a05925e23c320613859b103b6a62e4af5bd564b). But I'm not likely to have time to chase down the problem any time soon.
@donv, do you want to look into it?