diff --git a/app/controllers/v0/readings_controller.rb b/app/controllers/v0/readings_controller.rb index 397a4ceb..71ae774f 100644 --- a/app/controllers/v0/readings_controller.rb +++ b/app/controllers/v0/readings_controller.rb @@ -57,11 +57,6 @@ def csv_archive @device = Device.find(params[:id]) authorize @device, :update? - if @device.kit.nil? - render json: { id: "error", message: "Device does not have a kit", url: "", errors: "" }, status: 420 - return - end - if !@device.csv_export_requested_at or (@device.csv_export_requested_at < 15.minutes.ago) @device.update_column(:csv_export_requested_at, Time.now.utc) if Rails.env.test? diff --git a/app/models/device.rb b/app/models/device.rb index e170a154..3961869a 100644 --- a/app/models/device.rb +++ b/app/models/device.rb @@ -71,7 +71,7 @@ class Device < ActiveRecord::Base def self.ransackable_associations(auth_object = nil) [ - "components", "devices_tags", "kit", "owner", + "components", "devices_tags", "owner", "pg_search_document" , "postprocessing", "sensors", "tags" ] diff --git a/spec/models/device_spec.rb b/spec/models/device_spec.rb index ffdf18b2..6ef906b1 100644 --- a/spec/models/device_spec.rb +++ b/spec/models/device_spec.rb @@ -303,8 +303,8 @@ end it "updates the timestamp for components with the given sensor ids" do - expect(@component_1).to receive(:update).with(last_reading_at: @timestamp) @device.update_component_timestamps(@timestamp, [1]) + expect(@component_1.reload.last_reading_at).to eq(@timestamp) end it "does not update the timesatamp for components without the given sensor ids" do