rocket_cms 0.5.20 → 0.5.21
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/models/concerns/mappable.rb +13 -8
- data/lib/rocket_cms/migration.rb +2 -0
- data/lib/rocket_cms/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 93821dd64e38c2cba0c1b8df382f67b95213a641
|
4
|
+
data.tar.gz: 76ffee3cd546f074d7400a0c916e965abeed38a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07cba499da79fa9184d3431643cf32cd253b0373e6a860ce6d194cf58ee6b02e10177385f3b05245f50fa762e391a9ccb464c5280483f0579b8b475f779063b3
|
7
|
+
data.tar.gz: 5ed17db9dcad5df57b928cc3b5fc42f752622bbdc13f82241c9467986b5a30eed89e41bbd38e6b69db2ac531fb93cb43321487c2291ec1878fa48d4388d9d029
|
data/Gemfile.lock
CHANGED
@@ -23,14 +23,21 @@ module Mappable
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
|
27
|
-
after_validation
|
28
|
-
|
26
|
+
geocoded_by :geo_address
|
27
|
+
after_validation :do_geocode
|
28
|
+
end
|
29
|
+
|
30
|
+
def do_geocode
|
31
|
+
if geo_address.blank?
|
32
|
+
if RocketCMS.mongoid?
|
29
33
|
self.coordinates = nil
|
30
34
|
else
|
31
|
-
|
32
|
-
|
33
|
-
|
35
|
+
self.latitude = nil
|
36
|
+
self.longitude = nil
|
37
|
+
end
|
38
|
+
else
|
39
|
+
if (lat.nil? || lon.nil?) && (new_record? || address_changed? || coordinates.nil? || map_address_changed?)
|
40
|
+
geocode
|
34
41
|
end
|
35
42
|
end
|
36
43
|
end
|
@@ -61,8 +68,6 @@ module Mappable
|
|
61
68
|
def has_map?
|
62
69
|
(!lat.blank? && !lon.blank?) || !coordinates.nil?
|
63
70
|
end
|
64
|
-
|
65
|
-
geocoded_by :geo_address
|
66
71
|
|
67
72
|
def to_map
|
68
73
|
{
|
data/lib/rocket_cms/migration.rb
CHANGED
data/lib/rocket_cms/version.rb
CHANGED