rgeo-activerecord 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f94beffe14f68a9d360669c0bca51418c0664927
4
- data.tar.gz: c01b8a49ffef9f9b827821d84f5f892f01846d52
3
+ metadata.gz: c7eb9363bf2ff9df529e4df824e216d4020383a4
4
+ data.tar.gz: fc42ba79ef9e014b201ed9e0ada19aa097f2b95e
5
5
  SHA512:
6
- metadata.gz: f03466ff65bda17394763232137d63d88ba3a13e5fedd218ef34d2c86fe4a42b4dab3cd12ae997f5e98af8521f67d50ce05ae26465d3643b2d3efaffe8bda4e2
7
- data.tar.gz: e6d12a4be7fa31702edbf53795b5f082d1755fd8a8efa4db33979f031a3664b55087687c11557fbb59166aa31e9790d83d79eec9d5a64f758fe209f763a77303
6
+ metadata.gz: e04b5cac8c5de138c78de8ac43c6c7b2ab7b9479340db4fd62acdb498b5d799fda7be8ea73e378d3e37c225e8d23c53d012574d44a39dd8247d36fb57a9845e5
7
+ data.tar.gz: 14d81921b88784b5c251f589c5cfc912c063f753a059138d52156cfe40eaed029462413840d1e0c672448708eedeecfe0df9602f62dc3225fa2378e36531ba1a
data/History.md CHANGED
@@ -1,3 +1,21 @@
1
+ ### 1.2.0 / 2014-08-21
2
+
3
+ * Support ActiveRecord 4.2
4
+
5
+ ### 1.1.0 / 2014-06-17
6
+
7
+ * Relax rgeo gem dependency
8
+
9
+ ### 1.0.0 / 2014-05-06
10
+
11
+ * Require ruby 1.9.3+
12
+ * Require ActiveRecord 4+
13
+ * General refactoring and cleanup
14
+
15
+ ### 0.6.0 / 2014-05-06
16
+
17
+ * Support Rails 4, Arel 4
18
+
1
19
  ### 0.5.0 / 2013-02-27
2
20
 
3
21
  * No changes. Rereleased as 0.5.0 final.
@@ -36,7 +36,7 @@ module RGeo
36
36
  def visit_in_spatial_context(node_, *args)
37
37
  case node_
38
38
  when ::String
39
- "#{st_func('ST_WKTToSQL')}(#{visit_String(node_, *args)})"
39
+ "#{st_func('ST_WKTToSQL')}(#{quote(node_)})"
40
40
  when ::RGeo::Feature::Instance
41
41
  visit_RGeo_Feature_Instance(node_, *args)
42
42
  when ::RGeo::Cartesian::BoundingBox
@@ -126,9 +126,13 @@ module RGeo
126
126
  ::ActiveRecord::SchemaDumper.send :include, GeoSchemaDumper
127
127
 
128
128
 
129
- # Tell ActiveRecord to cache spatial attribute values so they don't get re-parsed on every access.
129
+ # attribute_types_cached_by_default was removed in ActiveRecord 4.2
130
+ # :cache_attributes does not work since the connection may not yet be established
130
131
 
131
- ::ActiveRecord::Base.attribute_types_cached_by_default << :spatial
132
+ if ::ActiveRecord.version < Gem::Version.new("4.2.0.a")
133
+ # cache spatial attribute values so they don't get re-parsed on every access.
134
+ ::ActiveRecord::Base.attribute_types_cached_by_default << :spatial
135
+ end
132
136
 
133
137
  # :startdoc:
134
138
  end
@@ -1,5 +1,5 @@
1
1
  module RGeo
2
2
  module ActiveRecord
3
- VERSION = '1.1.0'.freeze
3
+ VERSION = '1.2.0'.freeze
4
4
  end
5
5
  end
@@ -57,7 +57,15 @@ module RGeo
57
57
 
58
58
  def test_arel_visit_SpatialConstantNode
59
59
  visitor = arel_visitor
60
- sql = visitor.accept(Arel.spatial('POINT (1.0 2.0)'))
60
+
61
+ # :accept API changed in Arel 6.0:
62
+ # https://github.com/rails/arel/commit/fcd11dcb99d69d
63
+ sql = if Arel::VERSION > "6.0.0"
64
+ visitor.accept(Arel.spatial('POINT (1.0 2.0)'), Arel::Collectors::PlainString.new)
65
+ else
66
+ visitor.accept(Arel.spatial('POINT (1.0 2.0)'))
67
+ end
68
+
61
69
  assert_equal("ST_WKTToSQL('POINT (1.0 2.0)')", sql)
62
70
  end
63
71
  end
@@ -9,7 +9,7 @@ MINITEST_CLASS = if defined?(::Minitest::Test)
9
9
  end
10
10
 
11
11
  Arel::Visitors::PostgreSQL.send(:include, ::RGeo::ActiveRecord::SpatialToSql)
12
- Arel::Table.engine = Arel::Sql::Engine.new(FakeRecord::Base.new)
12
+ Arel::Table.engine = FakeRecord::Base.new
13
13
 
14
14
  def arel_visitor
15
15
  Arel::Visitors::PostgreSQL.new(Arel::Table.engine.connection)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgeo-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Azuma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-17 00:00:00.000000000 Z
11
+ date: 2014-08-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rgeo
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  version: '0'
109
109
  requirements: []
110
110
  rubyforge_project:
111
- rubygems_version: 2.3.0
111
+ rubygems_version: 2.4.1
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: An RGeo module providing spatial extensions to ActiveRecord.