object_attorney 2.10.6 → 2.10.7

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGI5YjAyYzdlODkyZWZhMjNlNGJjNzljNDI3YmRkYmY0NzRiMjFmMQ==
4
+ MjdkN2UzMGQ0YjgwNTMxN2Q4YjEyMDY1OWE1YmZiN2JjYmZhMDI4Mw==
5
5
  data.tar.gz: !binary |-
6
- MDc0OTc4MGQ0ZDY4NWNhYTQyYTUyMDYxZTg3NWQ4NzQzM2NhYmI3Ng==
6
+ MWM2YzBmZTg1NzBmMTRkZWM2YmE1YWQ5YzVkZjc5OWUxZTU1YzZkYg==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTBkNmRhNjBkM2RkMTBiMWY3ZjYzZTVkMjc5Yjg4OWE5ZWYxZjhkY2ExZDE5
10
- NjEwMmQzZWUyMDg1ZWI4YWJiZDQzNTFkNjU3Zjc4Y2UzZDViZjcwZTI0OWYx
11
- NzY3ZWJkODFmZmRkYzgxNzJiZjU3MjU2NjNhZTc2Y2U1ZTA5NWU=
9
+ NmUwODRmNmEzOWY4Zjg2YTNiY2QyZWYwNDMwMjlkNjBmODJlMWIzOWZjOTUw
10
+ N2E0MzgyZGI4MTMyYTNmZDRkNDBkYjYyM2E2ZDdjYjQ5YThhNGEyMjFhZDY3
11
+ ODc4MzhmMmRhNmI2YjZkMGU3N2Y4ZTljYTkxOGJmNmNkMWEwZTc=
12
12
  data.tar.gz: !binary |-
13
- ZTNlMzMwNmQyOTIwZTNhZjJkMDZlMjAxOTQzYjEzYWVmMzIxOTU0MDlhZjdh
14
- ZjQ1MGM0OTAwOGI3Y2JmNTFhNTlhNDA0MDc1OTg0YzQ3NzBhN2Q4Y2UwMTE1
15
- ODRkMWNjMmFhYmNhYTkxZGVkMjE5ZDkwOTM4ZDViOWNkMTk4MDE=
13
+ NGJjM2ZhNDdkMGZiZDc1YzMyMWI2M2ZlOTU5M2QzMjQ4YThlYWMzNjkzNTVi
14
+ Y2ExNzhhYTIyZjExYTBmZjQwZjdhMWRlZjM2Nzk0NGUwZWIxZDQyNjAwYjI2
15
+ M2E1ZGU5NTkxNjY4YjFmMmRjNDhjN2U3N2JlMmEyNmVlYzdkN2E=
@@ -263,7 +263,7 @@ module ObjectAttorney
263
263
  reflection = AssociationReflection.new(nested_object_name, represented_object_reflection, options)
264
264
 
265
265
  self.instance_variable_set("@#{nested_object_name}_reflection", reflection)
266
- self.instance_variable_set("@association_reflections", association_reflections | [reflection])
266
+ self.instance_variable_set("@association_reflections", association_reflections.merge(nested_object_name => reflection))
267
267
 
268
268
  self.send(:attr_accessor, "#{nested_object_name}_attributes".to_sym)
269
269
 
@@ -273,7 +273,7 @@ module ObjectAttorney
273
273
  end
274
274
 
275
275
  def association_reflections
276
- self.instance_variable_get("@association_reflections") || zuper_method('association_reflections') || []
276
+ self.instance_variable_get("@association_reflections") || zuper_method('association_reflections') || {}
277
277
  end
278
278
 
279
279
  def reflect_on_association(association)
@@ -281,9 +281,12 @@ module ObjectAttorney
281
281
  end
282
282
 
283
283
  def reflect_on_all_associations(macro = nil)
284
- macro ? association_reflections.select { |reflection| reflection.macro == macro } : association_reflections
284
+ macro ? association_reflections.values.select { |reflection| reflection.macro == macro } : association_reflections.values
285
285
  end
286
286
 
287
+ def reflections
288
+ association_reflections
289
+ end
287
290
 
288
291
  private ############################### PRIVATE METHODS ###########################
289
292
 
@@ -1,3 +1,3 @@
1
1
  module ObjectAttorney
2
- VERSION = "2.10.6"
2
+ VERSION = "2.10.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: object_attorney
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.10.6
4
+ version: 2.10.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Gonçalves
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-12 00:00:00.000000000 Z
11
+ date: 2014-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler