gmaps4rails 1.4.0 → 1.4.1
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.
@@ -1,13 +1,13 @@
|
|
1
1
|
<% #thanks to enable_css, user can avoid this css to be loaded
|
2
|
-
if enable_css == true
|
3
|
-
<% if Rails::VERSION::MAJOR >= 3
|
2
|
+
if enable_css == true && options[:scripts].nil? %>
|
3
|
+
<% if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR < 1 %>
|
4
4
|
<% content_for :head do %>
|
5
5
|
<%= stylesheet_link_tag 'gmaps4rails' %>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
8
8
|
<% end %>
|
9
9
|
<% content_for :scripts do %>
|
10
|
-
<% if enable_js == true
|
10
|
+
<% if enable_js == true && options[:scripts].try(:to_sym) != :none %>
|
11
11
|
<% case options[:map_options].try(:[], :provider) %>
|
12
12
|
<% when "openlayers" %>
|
13
13
|
<script src="http://www.openlayers.org/api/OpenLayers.js"></script>
|
@@ -22,7 +22,7 @@ if enable_css == true and options[:scripts].nil? %>
|
|
22
22
|
<script type="text/javascript" src="//google-maps-utility-library-v3.googlecode.com/svn/trunk/richmarker/src/richmarker-compiled.js"></script>
|
23
23
|
<% end %>
|
24
24
|
|
25
|
-
<% if Rails::VERSION::MAJOR >= 3
|
25
|
+
<% if Rails::VERSION::MAJOR >= 3 && Rails::VERSION::MINOR < 1 %>
|
26
26
|
<% unless options[:scripts].try(:to_sym) == :api %>
|
27
27
|
<%= javascript_include_tag 'gmaps4rails/gmaps4rails.base.js' %>
|
28
28
|
<% end %>
|
data/lib/gmaps4rails.rb
CHANGED
@@ -18,9 +18,10 @@ if defined?(Rails) && Rails::VERSION::MAJOR == 3
|
|
18
18
|
end
|
19
19
|
|
20
20
|
initializer "include acts_as_gmappable within ActiveRecord" do
|
21
|
-
if defined?
|
22
|
-
ActiveRecord::Base.send
|
23
|
-
|
21
|
+
if defined? ::ActiveRecord
|
22
|
+
ActiveRecord::Base.send :include, Gmaps4rails::ActsAsGmappable
|
23
|
+
elsif defined? ::Mongoid
|
24
|
+
Mongoid::Document.send :include, Gmaps4rails::ActsAsGmappable
|
24
25
|
end
|
25
26
|
end
|
26
27
|
|
@@ -5,7 +5,8 @@ class Array
|
|
5
5
|
output = "["
|
6
6
|
json_array = []
|
7
7
|
each do |object|
|
8
|
-
|
8
|
+
json = Gmaps4rails.create_json(object, &block)
|
9
|
+
json_array << json.to_s unless json.nil?
|
9
10
|
end
|
10
11
|
output << json_array * (",")
|
11
12
|
output << "]"
|
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: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 1
|
10
|
+
version: 1.4.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Benjamin Roth
|