duck_map 0.8.8 → 0.9.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 998646b7a2ecbbb0b71bf7af8cd501999084e7a0
4
- data.tar.gz: 19d024332882f156363d8acd560a342b23559927
3
+ metadata.gz: edb5f6641ee44fc53ee42c4326333a03bf92f58a
4
+ data.tar.gz: c689a439a43cf410584ea6f829681ab44f18dd7a
5
5
  SHA512:
6
- metadata.gz: ae04e83768656a7c138333239256016407d27ae1adaa54f4fb0c82689daa592439740d323eed8f69347e4064b91923b97107fb8f41d400260131aa7c552efe9f
7
- data.tar.gz: fcffff8d3d4b67d46c36c67a34a16dac12e469c911080de344130431959f3e07f31339562b6e61ae66257d80c7cfdd3e71e4cdbf6b3c4057f7db71b50f87db8b
6
+ metadata.gz: dcf98311dc089a814d5a23613efbbef6176d6e81dc02653b8f884905fa4b67ab6a60f92af28f77e3a4eeb583ebdd4e0c37552017ac7f785e8c8a469760d699f7
7
+ data.tar.gz: 1cb7c3261490d9f15bf0308433d73c80b7d48cbd17bffeae9d4fcea399a45c0fe8b09d7be5fc6350d7abf1caa7169273308edbc6c81dccac1b7ccf4cf2c2691b
@@ -128,7 +128,8 @@ module DuckMap
128
128
  def find_first_model_object
129
129
  model_object = self.find_model_object
130
130
 
131
- if model_object.kind_of?(Array) && model_object.first.kind_of?(ActiveRecord::Base)
131
+ if model_object.kind_of?(Array) &&
132
+ (model_object.first.kind_of?(ActiveRecord::Base) || model_object.first.kind_of?(Mongoid::Document))
132
133
  model_object = model_object.first
133
134
  end
134
135
 
@@ -153,11 +154,11 @@ module DuckMap
153
154
  list.each do |obj_sym|
154
155
  obj = self.instance_variable_get(obj_sym)
155
156
  if obj
156
- if obj.kind_of?(ActiveRecord::Base)
157
+ if obj.kind_of?(ActiveRecord::Base) || obj.kind_of?(Mongoid::Document)
157
158
  model_object = obj
158
159
  break
159
160
  elsif obj.kind_of?(Array) &&
160
- obj.first.kind_of?(ActiveRecord::Base) &&
161
+ (obj.first.kind_of?(ActiveRecord::Base) || obj.first.kind_of?(Mongoid::Document)) &&
161
162
  candidate.blank?
162
163
  candidate = obj
163
164
  end
@@ -60,6 +60,11 @@ module DuckMap
60
60
  ActiveRecord::Base.send :include, InheritableClassAttributes
61
61
  ActiveRecord::Base.send :include, Attributes
62
62
  ActiveRecord::Base.send :include, SitemapObject
63
+
64
+ Mongoid::Document.send :include, InheritableClassAttributes
65
+ Mongoid::Document.send :include, Attributes
66
+ Mongoid::Document.send :include, SitemapObject
67
+
63
68
  end
64
69
 
65
70
  ActiveSupport.on_load(:before_initialize) do
@@ -101,7 +101,7 @@ module DuckMap
101
101
 
102
102
  # data_rows may have changed from an Array to a model object.
103
103
  # Make data_rows an Array if it has been switched to an model object.
104
- if data_rows.kind_of?(ActiveRecord::Base)
104
+ if data_rows.kind_of?(ActiveRecord::Base) || data_rows.kind_of?(Mongoid::Document)
105
105
  data_rows = [data_rows]
106
106
  end
107
107
 
@@ -128,7 +128,7 @@ module DuckMap
128
128
 
129
129
  # data_rows may have changed from an Array to a model object.
130
130
  # Make data_rows an Array if it has been switched to an model object.
131
- if data_rows.kind_of?(ActiveRecord::Base)
131
+ if data_rows.kind_of?(ActiveRecord::Base) || data_rows.kind_of?(Mongoid::Document)
132
132
  data_rows = [data_rows]
133
133
  end
134
134
 
@@ -1,3 +1,3 @@
1
1
  module DuckMap
2
- VERSION = "0.8.8"
2
+ VERSION = "0.9.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: duck_map
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.8
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Duckett
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-27 00:00:00.000000000 Z
11
+ date: 2014-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails