mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
Refactor order cycle same_dates method
This commit is contained in:
@@ -315,7 +315,7 @@ class OrderCycle < ApplicationRecord
|
||||
|
||||
def same_datetime_value(attribute, string)
|
||||
return true if self[attribute].blank? && string.blank?
|
||||
return false if [[attribute].present?, string.present?].include?(false)
|
||||
return false if self[attribute].blank? || string.blank?
|
||||
|
||||
DateTime.parse(string).to_fs(:short) == self[attribute]&.to_fs(:short)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user