app/models/concerns/mappable.rb in rocket_cms-0.6.3 vs app/models/concerns/mappable.rb in rocket_cms-0.6.4
- old
+ new
@@ -11,21 +11,23 @@
field :map_address, type: String
field :map_hint, type: String
field :lat, type: Float
field :lon, type: Float
- else
- def coordinates
- if latitude.nil? || longitude.nil?
- nil
- else
- [longitude, latitude]
- end
- end
end
geocoded_by :geo_address
after_validation :do_geocode
+ end
+
+ if RocketCMS.active_record?
+ def coordinates
+ if latitude.nil? || longitude.nil?
+ nil
+ else
+ [longitude, latitude]
+ end
+ end
end
def do_geocode
if geo_address.blank?
if RocketCMS.mongoid?