Created
October 31, 2008 17:17
-
-
Save NZKoz/21353 to your computer and use it in GitHub Desktop.
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
begin | |
require_library_or_gem 'pg' | |
rescue LoadError => e | |
begin | |
require_library_or_gem 'postgres' | |
class PGresult | |
alias_method :nfields, :num_fields unless self.method_defined?(:nfields) | |
alias_method :ntuples, :num_tuples unless self.method_defined?(:ntuples) | |
alias_method :ftype, :type unless self.method_defined?(:ftype) | |
alias_method :cmd_tuples, :cmdtuples unless self.method_defined?(:cmd_tuples) | |
end | |
rescue LoadError | |
raise e | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment