Skip to content

Commit

Permalink
Merge pull request #1507 from sparc-request/kg-response_filter_incomp…
Browse files Browse the repository at this point in the history
…lete_form_bug

KG - Incomplete Form Response State Filtering
  • Loading branch information
Stuart-Johnson committed Aug 22, 2018
2 parents 21fbd3d + 5348bb0 commit e046084
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/surveyor/responses_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def get_incomplete_form_responses
p.sub_service_requests.each do |ssr|
ssr.forms_to_complete.select do |f|
# Apply the State, Survey/Form, and Start/End Date filters manually
(@filterrific.with_state.try(&:empty?) || (@filterrific.with_state.try(&:any?) && @filterrific.with_state.include?(f.active))) &&
(@filterrific.with_state.try(&:empty?) || (@filterrific.with_state.try(&:any?) && @filterrific.with_state.include?(f.active ? 1 : 0))) &&
(@filterrific.with_survey.try(&:empty?) || (@filterrific.with_survey.try(&:any?) && @filterrific.with_survey.include?(f.id)))
end.each do |f|
responses << Response.new(survey: f,respondable: ssr)
Expand Down

0 comments on commit e046084

Please sign in to comment.