gmaps4rails 1.4.3 → 1.4.4
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.
- data/README.rdoc +1 -1
- data/lib/gmaps4rails/acts_as_gmappable.rb +15 -15
- data/lib/gmaps4rails/json_handler.rb +1 -1
- metadata +5 -5
data/README.rdoc
CHANGED
@@ -23,15 +23,15 @@ module Gmaps4rails
|
|
23
23
|
Rails.logger.warn(e)
|
24
24
|
#TODO add customization here?
|
25
25
|
else #if no exception, save the values
|
26
|
-
self.send(gmaps4rails_options[:lng_column]
|
27
|
-
self.send(gmaps4rails_options[:lat_column]
|
26
|
+
self.send("#{gmaps4rails_options[:lng_column]}=", coordinates.first[:lng]) if self.respond_to?("#{gmaps4rails_options[:lng_column]}=")
|
27
|
+
self.send("#{gmaps4rails_options[:lat_column]}=", coordinates.first[:lat]) if self.respond_to?("#{gmaps4rails_options[:lat_column]}=")
|
28
28
|
unless gmaps4rails_options[:normalized_address].nil?
|
29
|
-
self.send(gmaps4rails_options[:normalized_address]
|
29
|
+
self.send("#{gmaps4rails_options[:normalized_address]}=", coordinates.first[:matched_address])
|
30
30
|
end
|
31
31
|
# Call the callback method to let the user do what he wants with the data
|
32
32
|
self.send(gmaps4rails_options[:callback], coordinates.first[:full_data]) unless gmaps4rails_options[:callback].nil?
|
33
33
|
if Gmaps4rails.condition_eval(self, gmaps4rails_options[:check_process])
|
34
|
-
self
|
34
|
+
self.send("#{gmaps4rails_options[:checker]}=", true)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -58,17 +58,17 @@ module Gmaps4rails
|
|
58
58
|
#instance method containing all the options to configure the behaviour of the gem regarding the current Model
|
59
59
|
define_method "gmaps4rails_options" do
|
60
60
|
{
|
61
|
-
:lat_column => args[:lat]
|
62
|
-
:lng_column => args[:lng]
|
63
|
-
:check_process => args[:check_process].nil?
|
64
|
-
:checker => args[:checker]
|
65
|
-
:msg => args[:msg]
|
66
|
-
:validation => args[:validation].nil?
|
67
|
-
:normalized_address => args[:normalized_address],
|
68
|
-
:address => args[:address]
|
69
|
-
:callback => args[:callback],
|
70
|
-
:language => args[:language]
|
71
|
-
:protocol => args[:protocol]
|
61
|
+
:lat_column => args[:lat] || "latitude",
|
62
|
+
:lng_column => args[:lng] || "longitude",
|
63
|
+
:check_process => args[:check_process].nil? ? true : args[:check_process],
|
64
|
+
:checker => args[:checker] || "gmaps",
|
65
|
+
:msg => args[:msg] || "Address invalid",
|
66
|
+
:validation => args[:validation].nil? ? true : args[:validation],
|
67
|
+
:normalized_address => args[:normalized_address],
|
68
|
+
:address => args[:address] || "gmaps4rails_address",
|
69
|
+
:callback => args[:callback],
|
70
|
+
:language => args[:language] || "en",
|
71
|
+
:protocol => args[:protocol] || "http"
|
72
72
|
}
|
73
73
|
end
|
74
74
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gmaps4rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 4
|
10
|
+
version: 1.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benjamin Roth
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-01-
|
19
|
+
date: 2012-01-30 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: json
|
@@ -107,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements: []
|
108
108
|
|
109
109
|
rubyforge_project:
|
110
|
-
rubygems_version: 1.8.
|
110
|
+
rubygems_version: 1.8.15
|
111
111
|
signing_key:
|
112
112
|
specification_version: 3
|
113
113
|
summary: Enables easy display of items (taken from a Rails 3 model) on a Google Maps (JS API V3), OpenLayers, Mapquest and Bing. Geocoding + Directions included.
|