app/controllers/api/abstract_controller.rb
def maybe_enforce_row_lock
      if stale_data?
        name = resource.class.model_name.human.downcase
        msg = "Discarding stale #{name} record (#{resource.id})"
        current_device.delay.tell(msg, ["error"], "warn")
        render json: { stale_record: STALE_RECORD }, status: 409
      end
    end
# If FarmBot OS goes offline for a very long time,
# you don't want to corrupt user data with stale records.
If FarmBot OS goes offline for a very long time,
you don't want to corrupt user data with stale records.
If FarmBot OS goes offline for a very long time you don ' t want to corrupt user data with stale records .
def maybe_enforce_row_lock
      if stale_data?
        name = resource.class.model_name.human.downcase
        msg = "Discarding stale #{name} record (#{resource.id})"
        current_device.delay.tell(msg, ["error"], "warn")
        render json: { stale_record: STALE_RECORD }, status: 409
      end
    end
def maybe_enforce_row_lock if stale_data? name = resource . class . model_name . human . downcase msg = "Discarding stale #{name} record (#{resource.id})" current_device . delay . tell ( msg , [ "error" ] , "warn" ) render json : { stale_record : STALE_RECORD } , status : 409 end end
If FarmBot OS goes offline for a very long time,
you don't want to corrupt user data with stale records.
If FarmBot OS goes offline for a very long time you don ' t want to corrupt user data with stale records .