Skip to content

Commit

Permalink
Merge pull request #255 from fablabbcn/bugfix/254-search-devices-by-p…
Browse files Browse the repository at this point in the history
…ostprocessing

Ensure that devices are searchable by the presence of a postprocessing
  • Loading branch information
oscgonfer authored Sep 25, 2023
2 parents ec42c6f + 0b2b1b8 commit 958485b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/postprocessing.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
class Postprocessing < ApplicationRecord
belongs_to :device

def self.ransackable_attributes(auth_object = nil)
["blueprint_url", "created_at", "device_id", "forwarding_params", "hardware_url", "id", "latest_postprocessing", "meta", "updated_at"]
end
end
5 changes: 5 additions & 0 deletions spec/requests/v0/devices_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@
expect(response.status).to eq(400)
end

it "allows searching by presence of postprocessing" do
json = api_get "devices?q[postprocessing_id_not_null]=1"
expect(response.status).to eq(200)
end

end
end

Expand Down

0 comments on commit 958485b

Please sign in to comment.