Skip to content

Commit

Permalink
remove kit references that i missed
Browse files Browse the repository at this point in the history
  • Loading branch information
timcowlishaw committed Oct 20, 2023
1 parent 4851023 commit de39fd7
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
5 changes: 0 additions & 5 deletions app/controllers/v0/readings_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
2 changes: 1 addition & 1 deletion app/models/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
]
Expand Down
2 changes: 1 addition & 1 deletion spec/models/device_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit de39fd7

Please sign in to comment.