Skip to content
This repository has been archived by the owner on Oct 27, 2020. It is now read-only.

Adjusted to ActiveRecord > 4 #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion activerecord-spatialite-adapter.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@
s_.extra_rdoc_files = ::Dir.glob("*.rdoc")
s_.test_files = ::Dir.glob("test/**/tc_*.rb")
s_.platform = ::Gem::Platform::RUBY
s_.add_dependency('rgeo-activerecord', '~> 0.4.3')
s_.add_dependency('rgeo-activerecord', '~> 1.0.0')
s_.add_dependency('sqlite3', '>= 1.3.5')
end
5 changes: 3 additions & 2 deletions lib/active_record/connection_adapters/spatialite_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,11 @@ def self.spatialite_connection(config_)
raise "Cannot read libspatialite library at #{path_}"
end
unless path_
prefixes_ = ['/usr/local/spatialite', '/usr/local/libspatialite', '/usr/local', '/opt/local', '/sw/local', '/usr']
prefixes_ = ['/usr/local/spatialite/lib', '/usr/local/libspatialite/lib',
'/usr/local/lib', '/opt/local/lib', '/sw/local/lib', '/usr/lib/x86_64-linux-gnu']
suffixes_ = ['so', 'dylib'].join(',')
prefixes_.each do |prefix_|
pa_ = ::Dir.glob("#{prefix_}/lib/libspatialite.{#{suffixes_}}")
pa_ = ::Dir.glob("#{prefix_}/libspatialite.{#{suffixes_}}")
if pa_.size > 0
path_ = pa_.first
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module ConnectionAdapters
module SpatiaLiteAdapter


class SpatialColumn < ConnectionAdapters::SQLiteColumn
class SpatialColumn < ConnectionAdapters::SQLite3Column


FACTORY_SETTINGS_CACHE = {}
Expand Down