mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-30 06:31:16 +00:00
Simplify safe navigation operator use < and []
This commit is contained in:
@@ -33,7 +33,7 @@ class ProxyOrder < ApplicationRecord
|
||||
end
|
||||
|
||||
def cancel
|
||||
return false unless order_cycle.orders_close_at&. > Time.zone.now
|
||||
return false unless order_cycle.orders_close_at&.>(Time.zone.now)
|
||||
|
||||
transaction do
|
||||
update_column(:canceled_at, Time.zone.now)
|
||||
@@ -43,7 +43,7 @@ class ProxyOrder < ApplicationRecord
|
||||
end
|
||||
|
||||
def resume
|
||||
return false unless order_cycle.orders_close_at&.send(:>, Time.zone.now)
|
||||
return false unless order_cycle.orders_close_at&.>(Time.zone.now)
|
||||
|
||||
transaction do
|
||||
update_column(:canceled_at, nil)
|
||||
|
||||
@@ -675,7 +675,7 @@ module Spree
|
||||
end
|
||||
|
||||
def skip_payment_for_subscription?
|
||||
subscription.present? && order_cycle.orders_close_at&.send(:>, Time.zone.now)
|
||||
subscription.present? && order_cycle.orders_close_at&.>(Time.zone.now)
|
||||
end
|
||||
|
||||
def require_customer?
|
||||
|
||||
@@ -10,7 +10,7 @@ class TagRule
|
||||
end
|
||||
|
||||
def tags_match?(variant)
|
||||
variant_tags = variant&.send(:[], "tag_list") || []
|
||||
variant_tags = variant&.[]("tag_list") || []
|
||||
preferred_tags = preferred_variant_tags.split(",")
|
||||
(variant_tags & preferred_tags).any?
|
||||
end
|
||||
|
||||
@@ -13,7 +13,7 @@ module Api
|
||||
end
|
||||
|
||||
def update_issues
|
||||
options[:order_update_issues]&.send(:[], object.order_id) || []
|
||||
options[:order_update_issues]&.[](object.order_id) || []
|
||||
end
|
||||
|
||||
def completed_at
|
||||
|
||||
Reference in New Issue
Block a user