Created
April 21, 2020 13:45
-
-
Save opensourceame/b14514fe237b3c125cbcc3e9ff44ab66 to your computer and use it in GitHub Desktop.
fix to make Rails 4 work with Postgres gem > 0.20.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# fix to make Rails 4 work with Postgres gem > 0.20.0 | |
# | |
# place this in your config/application.rb just after the Bundler.require() line | |
module Kernel | |
def gem_with_pg_fix(dep, *reqs) | |
if dep == "pg" && reqs == ["~> 0.15"] | |
reqs = ["~> 1.0"] | |
end | |
gem_without_pg_fix(dep, *reqs) | |
end | |
alias_method_chain :gem, :pg_fix | |
end | |
PGconn = PG::Connection | |
PGresult = PG::Result | |
PGError = PG::Error |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment