Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/spatial_adapter/postgresql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

module ActiveRecord::ConnectionAdapters
class PostgreSQLAdapter

def postgis_version
select_value("SELECT postgis_full_version()").scan(/POSTGIS="([\d\.]*)"/)[0][0]
rescue ActiveRecord::StatementInvalid
Expand Down
2 changes: 1 addition & 1 deletion lib/spatial_adapter/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module SpatialAdapter
class Railtie < Rails::Railtie
initializer "spatial_adapter.load_current_database_adapter" do
ActiveSupport.on_load :active_record do
adapter = ActiveRecord::Base.configurations[Rails.env]['adapter']
adapter = Rails.configuration.database_configuration[Rails.env]['adapter']
begin
require "spatial_adapter/#{adapter}"
rescue LoadError
Expand Down
2 changes: 1 addition & 1 deletion spatial_adapter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ Gem::Specification.new do |s|
s.add_development_dependency 'activerecord-jdbcmysql-adapter'
end

s.add_dependency 'activerecord', '>= 2.2.2', '< 3.2.0'
s.add_dependency 'activerecord', '>= 2.2.2', '<= 3.2.13'
s.add_dependency 'GeoRuby', '>= 1.3.0'
end