rails / arel

A Relational Algebra
2.06k stars 390 forks source link

activerecord (5.1.4) lib/active_record/relation/predicate_builder.rb:113:in `new' not passing a value, causing Arel 9.0.0 to fail #508

Closed ehatjissavvas closed 6 years ago

ehatjissavvas commented 6 years ago

failing in : 'object=model.where(column: value)' (in my case I have 'object=model.where(column: value).select(:column)' but the failure happened in the where clause) with : 'wrong number of arguments (given 0, expected 1)'

The system runs on ruby 2.4.2 and Rails 5.1.4 and I recently updated Arel 8.0.0 to 9.0.0

StackTrace:

if can_be_bound?(column_name, value)
              result[column_name] = Arel::Nodes::BindParam.new
              binds << build_bind_param(column_name, value)
end
ehatjissavvas commented 6 years ago

https://github.com/rails/rails/commit/213796fb4936dce1da2f0c097a054e1af5c25c2c#diff-2ec9993375ecb711e08452788d625581 The above commit in Rails (5.2.0) seems that fixes the issue, it will come with Rails 5.2 but is confusing as 5.2.0 is not released yet