Refactor order cycle same_dates method

This commit is contained in:
wandji20
2024-08-22 22:21:17 +01:00
parent 4d222c61c6
commit b6bfb4e866

View File

@@ -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