Open lfv89 opened 5 months ago
If an outdated_sync_field do not have a simple value, it should still be possible to use chewy:sync on that index.
outdated_sync_field
chewy:sync
If one defines an index with an updated_at similar to this one:
updated_at
field :updated_at, type: :date, value: ->(obj) do [obj.updated_at, obj.obj2.updated_at].compact.max end
Then chewy:sync will fail because inside supports_outdated_sync?:
supports_outdated_sync?
def supports_outdated_sync? updated_at_field = root.child_hash[outdated_sync_field] if outdated_sync_field !!updated_at_field && updated_at_field.value.nil? end
The condition updated_at_field.value.nil? will always be false since a proc is being used.
updated_at_field.value.nil?
Run rake chewy:sync on a index that defines the value of updated_at as a proc.
rake chewy:sync
Share here essential version information such as:
I would gladly jump on this if a maintainer could give me a few pointers to start with.
@sasha370 @AlexDavidoiu
Expected behavior
If an
outdated_sync_field
do not have a simple value, it should still be possible to usechewy:sync
on that index.Actual behavior
If one defines an index with an
updated_at
similar to this one:Then
chewy:sync
will fail because insidesupports_outdated_sync?
:The condition
updated_at_field.value.nil?
will always be false since a proc is being used.Steps to reproduce the problem
Run
rake chewy:sync
on a index that defines the value ofupdated_at
as a proc.Version Information
Share here essential version information such as: