mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 13:05:19 +02:00
Skip trend values same class validations if any values are nil
This commit is contained in:
parent
70747320c0
commit
03cee1f121
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ class TimeSeries::Trend
|
||||||
attr_reader :series
|
attr_reader :series
|
||||||
|
|
||||||
def values_must_be_of_same_type
|
def values_must_be_of_same_type
|
||||||
unless current.class == previous.class || previous.nil?
|
unless current.class == previous.class || [ previous, current ].any?(&:nil?)
|
||||||
errors.add :current, "must be of the same type as previous"
|
errors.add :current, "must be of the same type as previous"
|
||||||
errors.add :previous, "must be of the same type as current"
|
errors.add :previous, "must be of the same type as current"
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue