spatial_adapter 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.0
1
+ 1.1.1
@@ -0,0 +1,13 @@
1
+ module SpatialAdapter
2
+ class Railtie < Rails::Railtie
3
+ initializer "spatial_adapter.load_current_database_adapter" do
4
+ adapter = ActiveRecord::Base.configurations[Rails.env]['adapter']
5
+ begin
6
+ require "spatial_adapter/#{adapter}"
7
+ rescue LoadError
8
+ raise SpatialAdapter::NotCompatibleError.new("spatial_adapter does not currently support the #{adapter} database.")
9
+ end
10
+ end
11
+ end
12
+ end
13
+
@@ -28,6 +28,9 @@ module SpatialAdapter
28
28
  :geometry => { :name => "GEOMETRY"}
29
29
  }
30
30
  end
31
+
32
+ class NotCompatibleError < ::StandardError
33
+ end
31
34
  end
32
35
 
33
36
  require 'spatial_adapter/common/raw_geom_info'
@@ -35,3 +38,4 @@ require 'spatial_adapter/common/spatial_column'
35
38
  require 'spatial_adapter/common/schema_definitions'
36
39
  require 'spatial_adapter/common/schema_dumper'
37
40
  require 'spatial_adapter/common/table_definition'
41
+ require 'spatial_adapter/railtie' if defined?(Rails::Railtie)
data/rails/init.rb CHANGED
@@ -3,11 +3,6 @@
3
3
  # This will load the adapter for the currently used database configuration, if
4
4
  # it exists.
5
5
 
6
- module SpatialAdapter
7
- class NotCompatibleError < ::StandardError
8
- end
9
- end
10
-
11
6
  begin
12
7
  adapter = ActiveRecord::Base.configurations[RAILS_ENV]['adapter']
13
8
  require "spatial_adapter/#{adapter}"
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 1
8
- - 0
9
- version: 1.1.0
8
+ - 1
9
+ version: 1.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Pete Deffendol
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-20 00:00:00 -06:00
17
+ date: 2010-04-29 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -65,6 +65,7 @@ files:
65
65
  - lib/spatial_adapter/common/table_definition.rb
66
66
  - lib/spatial_adapter/mysql.rb
67
67
  - lib/spatial_adapter/postgresql.rb
68
+ - lib/spatial_adapter/railtie.rb
68
69
  - rails/init.rb
69
70
  has_rdoc: true
70
71
  homepage: http://github.com/fragility/spatial_adapter