Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Depends on #34] Fix tests (and production API 500 errors, too! Yikes!) #35

Merged
merged 3 commits into from
Sep 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions app/controllers/api/v1/shelters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ def apply_params(shelters)

if params[:county].present?
filters[:county] = params[:county]
shelters = shelters.where("county ILIKE ?", "%#{@filters[:county]}%")
shelters = shelters.where("county ILIKE ?", "%#{filters[:county]}%")
end

if params[:shelter].present?
filters[:shelter] = params[:shelter]
shelters = shelters.where("shelter ILIKE ?", "%#{@filters[:shelter]}%")
shelters = shelters.where("shelter ILIKE ?", "%#{filters[:shelter]}%")
end

if params[:accepting].present?
Expand All @@ -44,8 +44,8 @@ def apply_params(shelters)
else
:yes
end
@filters[:accepting] = val
@shelters = @shelters.where(accepting: val)
filters[:accepting] = val
shelters = shelters.where(accepting: val)
end

if params[:special_needs].present?
Expand All @@ -54,8 +54,8 @@ def apply_params(shelters)
end

if params[:accessibility].present?
@filters[:accessibility] = params[:accessibility]
@shelters = @shelters.where("accessibility ILIKE ?", "%#{@filters[:accessibility]}%")
filters[:accessibility] = params[:accessibility]
shelters = shelters.where("accessibility ILIKE ?", "%#{filters[:accessibility]}%")
end

if params[:unofficial].present?
Expand Down
6 changes: 4 additions & 2 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ CREATE TABLE shelters (
allow_pets boolean,
private_sms character varying,
private_volunteer_data_mgr character varying,
unofficial boolean
unofficial boolean,
accessibility text
);


Expand Down Expand Up @@ -878,6 +879,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20170909175503'),
('20170909193921'),
('20170910045633'),
('20180914132709');
('20180914132709'),
('20180915035427');


131 changes: 119 additions & 12 deletions test/vcr_cassettes/needs.yml

Large diffs are not rendered by default.

140 changes: 126 additions & 14 deletions test/vcr_cassettes/shelters.yml

Large diffs are not rendered by default.