Rails 6
Closed this issue · 1 comments
oniram88 commented
During update of a rails 5.2.x application to Rails 6, I have encountered that the arel_extension is requiring the arel gem, but this now is full merged inside active-record 6. So when bundle install, the relative gem arel 9 overwrite active-record 6 arel, and cause an error.
Partial Gemfile.lock
.......
arel (9.0.0)
arel_extensions (1.2.3)
arel (>= 6.0)
........
Error:
ArgumentError: wrong number of arguments (given 2, expected 1)
/home/marino/.rvm/gems/ruby-2.5.3@cortobio/gems/arel-9.0.0/lib/arel/visitors/to_sql.rb:73:in `compile'
/home/marino/.rvm/gems/ruby-2.5.3@cortobio/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:25:in `to_sql_and_binds'
/home/marino/.rvm/gems/ruby-2.5.3@cortobio/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/database_statements.rb:61:in `select_all'
/home/marino/.rvm/gems/ruby-2.5.3@cortobio/gems/activerecord-6.0.0/lib/active_record/connection_adapters/abstract/query_cache.rb:107:in `select_all'
/home/marino/.rvm/gems/ruby-2.5.3@cortobio/gems/activerecord-6.0.0/lib/active_record/relation/calculations.rb:193:in `block in pluck'
to_sql.rb of active-record:
def compile(node, collector = Arel::Collectors::SQLString.new)
accept(node, collector).value
end
to_sql.rb of arel 9:
def compile node, &block
accept(node, Arel::Collectors::SQLString.new, &block).value
end
jdelporte commented
Hi,
I guess you want to use the version v2.0.0.rc (the stable version should be released soon) of the gem instead, with depends on ActiveRecord 6 and not Arel anymore (due to the recent changes you pointed out).