Skip to content
This repository has been archived by the owner on Mar 9, 2021. It is now read-only.

Commit

Permalink
Remove postgis reference.
Browse files Browse the repository at this point in the history
  • Loading branch information
etagwerker committed Sep 18, 2015
1 parent 654d2a9 commit 475f482
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,26 +25,3 @@ class Application < Rails::Application
config.active_record.raise_in_transactional_callbacks = true
end
end

# in config/application.rb, before the application loads
class ActiveRecordOverrideRailtie < Rails::Railtie
initializer "active_record.initialize_database.override" do |app|

ActiveSupport.on_load(:active_record) do
if url = ENV['DATABASE_URL']
ActiveRecord::Base.connection_pool.disconnect!
parsed_url = URI.parse(url)
config = {
adapter: 'postgis',
host: parsed_url.host,
encoding: 'unicode',
database: parsed_url.path.split("/")[-1],
port: parsed_url.port,
username: parsed_url.user,
password: parsed_url.password
}
establish_connection(config)
end
end
end
end

0 comments on commit 475f482

Please sign in to comment.