Skip to content

Instantly share code, notes, and snippets.

@johnston
Created December 5, 2019 14:05
Show Gist options
  • Select an option

  • Save johnston/84e7508828c86d49de1018667a71a421 to your computer and use it in GitHub Desktop.

Select an option

Save johnston/84e7508828c86d49de1018667a71a421 to your computer and use it in GitHub Desktop.
Fixes Rails < 4.2 PostgreSQL 12 "panic" issue
module ActiveRecord
module ConnectionAdapters
class PostgreSQLAdapter < AbstractAdapter
def set_standard_conforming_strings
old, self.client_min_messages = client_min_messages, 'error'
execute('SET standard_conforming_strings = on', 'SCHEMA') rescue nil
ensure
self.client_min_messages = old
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment