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
crutch execution should respect :update_fields option.
Actual behavior
crutch is executed regardless :update_fields option
Steps to reproduce the problem
classUsersIndex < Chewy::Indexindex_scopeUser....crutch:driver_roledo |collection|
::User.includes(employees: :group).where(id: collection.map(&:id)).group(:id,"groups.kind","groups.role").pluck(:id,Arel.sql("jsonb_build_object( 'driver_role', CASE WHEN (groups.kind = 'carrier' AND groups.role ='ca_driver') THEN TRUE ELSE FALSE END )")).to_hendfield:first_namefield:last_namefield:driver_role,type: :boolean,value: ->(user,crutch){crutch.driver_role.dig(user.id,"driver_role")}
...
end
I have an index definition with some crutches. The reindex operation always triggers a crutch execution even if I don't want to reindex that one by skipping the related field using
:update_fields
. Looks like the reason is this line of code https://github.com/toptal/chewy/blob/master/lib/chewy/index/import/bulk_builder.rb#L52 where we don't pass @fields option.Expected behavior
crutch execution should respect :update_fields option.
Actual behavior
crutch is executed regardless :update_fields option
Steps to reproduce the problem
call from the console
look at logs and confirm that
drivers
crutch SQL call has been madeVersion Information
Share here essential version information such as:
7.2.4
7.x
3.1.2
6.1.5
The text was updated successfully, but these errors were encountered: