smooth_operator 1.30.0 → 1.30.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZGJiZDVhYzQxYmIwMjNkZDcyZWI2ZWYwNzA5YTdkNDdlN2UzMGFjZg==
4
+ MzBkMzFiOTQ5ODg4Mzg0NmZmMzUzM2NiOWIxMjM2ZmZkOWZkZTM3OQ==
5
5
  data.tar.gz: !binary |-
6
- MjBkM2NhMWRjMThmZTg2NmM1NzA4MjVjNzM2ZTdjOTBjZjU3Mjk0OQ==
6
+ MGNjMTJjMDNhZjU3NDE4ZGRlYTdjNzQzYjRhMWYyZDBkMmY1NzEyNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- YzdlZWMwN2VkMDE4N2EwNjZkMjBhZmM0MzZmMTY5ZDU5Nzg1NzJiNjBkNjE2
10
- NzRhYjVmZDJhNGE4MWIwMTBhZTExZWJjZmRmODBiMzI2ZGQ3MjliMWM1OTFl
11
- NmEzOWNhMjRiNmQ1ZmJlNzAzMTY4ZWFiZmViMjE4ZjRmN2NmNDE=
9
+ NmUxOGQyZjIyYmM5OWQ4M2NmYmEzMWE1MGM5ODIwMTEyMzQ2N2M4NDcyZjg4
10
+ ODhhZTAzMjFlZjcyMWE3YmVjMDM5NThlODUyYjdhM2NlMGRmOGY5ZDQwNWQx
11
+ Yzc5OGY3MzE0YjRjMTJlNzIwZWM2MzVlMDg5ZWI2YzA5MzBjMjg=
12
12
  data.tar.gz: !binary |-
13
- MDA1MDc3NzQxMWQ4ZDYwYzhlZjc3ZmI5YmRiNzgwMTVkMGUyNmVmN2JjZWYx
14
- YmU2NDE2OTI0OGU1YWIyYTczM2VmMGMzY2NhN2Y4M2M0NWIyMDVhNzUzOTc0
15
- MjYyYmUwYWQyNmQxOTNjMzJiNTQyMDhkZTE2NGFiZGU2OTgyNzQ=
13
+ ZDczNTYxMzZhZDFjMmMzYjRiZDVkNDgzYzFkZjEzYzAwNzgyZjkzYzhhNWRh
14
+ NmQyZGI4N2FjOTAyMjhkMDAxZTcyZGYzZmYzYWMzMDc5YzU4MzNiOTI5MWU1
15
+ NmJlODNlYTIxMDQyNjFlYzBmYWYyYjAxZjcxNGMzNTNiMDBiMjA=
@@ -17,13 +17,19 @@ module SmoothOperator
17
17
  end
18
18
 
19
19
  def build(attributes = {})
20
- new_array, new_array_entry = get_array, new(attributes)
20
+ new_entries = if attributes.is_a?(Array)
21
+ attributes.map { |attrs| new(attrs) }
22
+ else
23
+ [new(attributes)]
24
+ end
21
25
 
22
- new_array.push new_array_entry
26
+ new_array = get_array
27
+
28
+ new_array.push *new_entries
23
29
 
24
30
  object.send("#{association}=", new_array)
25
31
 
26
- new_array_entry
32
+ attributes.is_a?(Array) ? new_entries : new_entries.first
27
33
  end
28
34
 
29
35
  undef :is_a?
@@ -19,12 +19,8 @@ module SmoothOperator
19
19
  end
20
20
  end
21
21
 
22
- def model_name=(name)
23
- @custom_model_name = name
24
- end
25
-
26
22
  def custom_model_name
27
- Helpers.get_instance_variable(self, :custom_model_name, nil)
23
+ get_option :model_name, nil
28
24
  end
29
25
 
30
26
  protected ############## PROTECTED #############
@@ -1,3 +1,3 @@
1
1
  module SmoothOperator
2
- VERSION = '1.30.0'
2
+ VERSION = '1.30.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smooth_operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.30.0
4
+ version: 1.30.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - João Gonçalves