Skip to content

Commit

Permalink
fix apostrophe in state field (#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
GcioGregg authored Jan 22, 2024
1 parent aa42604 commit e54155a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/models/institution.rb
Original file line number Diff line number Diff line change
Expand Up @@ -568,15 +568,15 @@ def self.unaccrediteds
# :nocov:
if state_country_search[1].present?
state = state_country_search[1].upcase.strip
filters << "state = '#{state}'"
filters << "physical_state = '#{state}'"
filters << "state = '#{state.gsub("'", "''")}'"
filters << "physical_state = '#{state.gsub("'", "''")}'"
filters << 'state IS NOT NULL'
filters << 'physical_state IS NOT NULL'
end
if state_country_search[2].present?
country = state_country_search[2].upcase.strip
filters << "country = '#{country}'"
filters << "physical_country = '#{country}'"
filters << "country = '#{country.gsub("'", "''")}'"
filters << "physical_country = '#{country.gsub("'", "''")}'"
filters << 'country IS NOT NULL'
filters << 'physical_country IS NOT NULL'
end
Expand Down

0 comments on commit e54155a

Please sign in to comment.