prevent eql_readings to be saved to db.
This commit is contained in:
@@ -77,8 +77,13 @@ class InSyncState < StatePattern::State
|
||||
next_is_gas = true # the usage is on the next line
|
||||
end
|
||||
}
|
||||
|
||||
reading.save
|
||||
|
||||
last_reading = Reading.last
|
||||
if last_reading.eql_reading?(reading)
|
||||
p "Nothing changed. Do not add to the database"
|
||||
else
|
||||
reading.save
|
||||
end
|
||||
return reading
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user