Requested changes

- replace direct instance variable use by instance getter use
This commit is contained in:
cyrillefr
2024-06-24 10:37:43 +02:00
parent 659111932c
commit 980ce95ab2

View File

@@ -18,9 +18,9 @@ class RemoveTransientData
def call
Rails.logger.info("#{self.class.name}: processing")
Spree::StateChange.where("created_at < ?", @expiration_date).delete_all
Spree::LogEntry.where("created_at < ?", @expiration_date).delete_all
Session.where("updated_at < ?", @expiration_date).delete_all
Spree::StateChange.where("created_at < ?", expiration_date).delete_all
Spree::LogEntry.where("created_at < ?", expiration_date).delete_all
Session.where("updated_at < ?", expiration_date).delete_all
clear_old_cart_data!
end
@@ -29,7 +29,7 @@ class RemoveTransientData
def clear_old_cart_data!
old_carts = Spree::Order.
where("spree_orders.state = 'cart' AND spree_orders.updated_at < ?", @expiration_date).
where("spree_orders.state = 'cart' AND spree_orders.updated_at < ?", expiration_date).
merge(orders_without_payments)
old_cart_line_items = Spree::LineItem.where(order_id: old_carts)