This file contains hidden or 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
| unless File.exist?('Gemfile') | |
| File.write('Gemfile', <<-GEMFILE) | |
| source 'https://rubygems.org' | |
| gem 'rails', '6.0.3' | |
| gem 'pg' | |
| GEMFILE | |
| system 'bundle' | |
| end |
This file contains hidden or 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
| class RawSQL | |
| include ActiveRecord::ConnectionAdapters::Quoting | |
| def initialize(filename) | |
| @filename = filename | |
| end | |
| def result(params) | |
| pg = ActiveRecord::Base.connection | |
| @type_map ||= PG::BasicTypeMapForResults.new(pg.raw_connection) |