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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 441d92e65a93736affc737d6b3553502b501dfe0
4
- data.tar.gz: dbd7853c197d8aaf01e89a2037b8d43981acb4d1
3
+ metadata.gz: 93821dd64e38c2cba0c1b8df382f67b95213a641
4
+ data.tar.gz: 76ffee3cd546f074d7400a0c916e965abeed38a5
5
5
  SHA512:
6
- metadata.gz: 8d393bdcf0c623bdad37bfaf38b5ad3c5a60d5e302e62ce1e11b2e47e7feab1925191ee8819b1a6f50c09f256f9e1bba215686ecd14dfd208c785cb303e0722f
7
- data.tar.gz: 8994fc3ee4aa32700a640a80047381bd63999dd88a472827ff168b397a731839d099798937947cd11a324351d831f21fc2b66dba91c31e10103d4dd504ecb344
6
+ metadata.gz: 07cba499da79fa9184d3431643cf32cd253b0373e6a860ce6d194cf58ee6b02e10177385f3b05245f50fa762e391a9ccb464c5280483f0579b8b475f779063b3
7
+ data.tar.gz: 5ed17db9dcad5df57b928cc3b5fc42f752622bbdc13f82241c9467986b5a30eed89e41bbd38e6b69db2ac531fb93cb43321487c2291ec1878fa48d4388d9d029
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rocket_cms (0.5.20)
4
+ rocket_cms (0.5.21)
5
5
  addressable
6
6
  coffee-rails
7
7
  devise
@@ -23,14 +23,21 @@ module Mappable
23
23
  end
24
24
  end
25
25
 
26
-
27
- after_validation do
28
- if geo_address.blank?
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
- if new_record? || address_changed? || coordinates.nil? || map_address_changed?
32
- geocode
33
- end
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
  {
@@ -24,6 +24,8 @@ module RocketCMS
24
24
  t.string :map_hint
25
25
  t.float :latitude
26
26
  t.float :longitude
27
+ t.float :lat
28
+ t.float :lon
27
29
  end
28
30
  end
29
31
  end
@@ -1,3 +1,3 @@
1
1
  module RocketCMS
2
- VERSION = "0.5.20"
2
+ VERSION = "0.5.21"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rocket_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.20
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv