object_attorney 2.6.0 → 2.6.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.
- checksums.yaml +8 -8
- data/lib/object_attorney/nested_objects.rb +0 -19
- data/lib/object_attorney/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
NGI5MTNkZDE0MmUyOWMyZTFmMjgwZWVmMDgyMGY3YjIyZGRjMzFiOA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
MzU5Y2EwOWY5MzA5NzE5ZWEyZDA5NjdlMTc3Y2U3N2FlNGU3MmU2MQ==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ODMwNmIzMjJiZWY0NGYxZjlhMjE1NzJlZmYzOTNhODE4M2VlMmFkNzU3YTA2
|
|
10
|
+
Mjg5MzczMjMwYmI5YmE0NmQ5M2FiMTJlODQ4MWM2OWQ4YjlmYmFiN2Q3Njgz
|
|
11
|
+
NWFkZTU3OWE5Njk5ODk4NjUzMDNhYmM0NDE4MzA3YWNhYmM4YTc=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
OThjNGRhYThjZmU2NWQ4OGU2ZGY5YzU5MzVkODNiMDViYjM5OGY4N2I5OGQ3
|
|
14
|
+
OTc3YjRhNWMyMTEwNTFmMWUyYjhhN2ZjNTMyNDEyMzM1MThkMjc5YjExMTE1
|
|
15
|
+
OWNkZmUzMDFhZDU0OTdiMTk4ZDk1NzM4ZGFjMTZhZTExOTg1OTU=
|
|
@@ -235,8 +235,6 @@ module ObjectAttorney
|
|
|
235
235
|
define_method(nested_object_name) { nested_getter(nested_object_name) }
|
|
236
236
|
define_method("build_#{reflection.single_name}") { |attributes = {}, nested_object = nil| build_nested_object(nested_object_name, attributes) }
|
|
237
237
|
define_method("existing_#{nested_object_name}") { existing_nested_objects(nested_object_name) }
|
|
238
|
-
|
|
239
|
-
define_nested_ids_accessor(nested_object_name, reflection)
|
|
240
238
|
end
|
|
241
239
|
|
|
242
240
|
def association_reflections
|
|
@@ -254,23 +252,6 @@ module ObjectAttorney
|
|
|
254
252
|
|
|
255
253
|
private ############################### PRIVATE METHODS ###########################
|
|
256
254
|
|
|
257
|
-
# def define_nested_attributes_accessor(nested_object_name)
|
|
258
|
-
# self.send(:attr_writer, "#{nested_object_name}_attributes".to_sym)
|
|
259
|
-
# module_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
|
260
|
-
# def #{nested_object_name}_attributes; @#{nested_object_name}_attributes ||= {}; end
|
|
261
|
-
# RUBY_EVAL
|
|
262
|
-
# end
|
|
263
|
-
|
|
264
|
-
def define_nested_ids_accessor(nested_object_name, reflection)
|
|
265
|
-
return nil unless reflection.has_many?
|
|
266
|
-
|
|
267
|
-
module_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
|
|
268
|
-
def #{reflection.single_name}_ids
|
|
269
|
-
@#{reflection.single_name}_ids ||= nested_object_name.map(&:#{reflection.primary_key})
|
|
270
|
-
end
|
|
271
|
-
RUBY_EVAL
|
|
272
|
-
end
|
|
273
|
-
|
|
274
255
|
def accepts_nested_objects_overwrite_macro(nested_object_name, options, macro)
|
|
275
256
|
default_options = { macro: macro }
|
|
276
257
|
options = options.is_a?(Hash) ? options.merge(default_options) : default_options
|
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.6.
|
|
4
|
+
version: 2.6.1
|
|
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-01-
|
|
11
|
+
date: 2014-01-31 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|