mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-04-03 06:59:14 +00:00
Requested changes
- replace direct instance variable use by instance getter use
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user