Skip to content

Commit

Permalink
Merge pull request #32 from softwareforgood/fix/ryan/postgres-error
Browse files Browse the repository at this point in the history
updates for postgres fix
  • Loading branch information
Ryan Bridge authored Dec 27, 2021
2 parents 5c2d9b0 + f5dfc41 commit 40c8850
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.2.6
ruby-2.2.9
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
source 'https://rubygems.org'
ruby '2.2.6'
ruby '2.2.9'

# the base rails libraries
gem 'pg'
gem 'pg', '~> 0.18.4'
gem 'rails', '~> 3.2.16'
gem 'rails_12factor'
gem 'thin'
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ DEPENDENCIES
jquery-datatables-rails!
jquery-rails (= 2.1.4)
json
pg
pg (~> 0.18.4)
poltergeist (~> 1.12)
prawn (~> 2.1.0)
prawn-table (~> 0.2.2)
Expand Down
10 changes: 10 additions & 0 deletions config/initializers/postgresql_adapter_monkeypatch.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'active_record/connection_adapters/postgresql_adapter'

class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
def set_standard_conforming_strings
old, self.client_min_messages = client_min_messages, 'warning'
execute('SET standard_conforming_strings = on', 'SCHEMA') rescue nil
ensure
self.client_min_messages = old
end
end

0 comments on commit 40c8850

Please sign in to comment.