slim_form_object 3.1.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7789745013fc14bc053cbfce3982ecfbaac028d925135abd6ac4729129746df
|
4
|
+
data.tar.gz: 2c679b2b95f1abccd9371b2b8502ff3dffbbf2c30b5588b619e07ffd528dbfe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56c1956ea98aa65d6f6d1ac159815ff947966550a21610ecea271bf7a19fa049fe38bee7599a8a9dd52dc4531d9c2923619da833280004807c7e5e08df892709
|
7
|
+
data.tar.gz: 6b8e22e5b95f2f246cba5f80caf9aeb22bbe27c53173bbe712a252ae11a9dfbd5a830f02edf551a2cf36d55b5123051e4e22987d5d9945b482e5e16e99345b0b
|
@@ -7,7 +7,7 @@ module SlimFormObject
|
|
7
7
|
|
8
8
|
def initialize(name: nil, attributes: {}, form_object: nil)
|
9
9
|
@name = name
|
10
|
-
@model = get_class_of(name)
|
10
|
+
@model = get_class_of(name, form_object&.base_modules[name&.to_sym])
|
11
11
|
@attributes = attributes
|
12
12
|
@form_object = form_object
|
13
13
|
@object = make_object
|
@@ -4,10 +4,10 @@ module SlimFormObject
|
|
4
4
|
include ::HelperMethods
|
5
5
|
extend ::HelperMethods
|
6
6
|
|
7
|
-
attr_accessor :params, :data_objects_arr
|
7
|
+
attr_accessor :params, :data_objects_arr, :base_modules
|
8
8
|
|
9
9
|
class << self
|
10
|
-
attr_accessor :
|
10
|
+
attr_accessor :base_modules
|
11
11
|
|
12
12
|
def set_model_name(name)
|
13
13
|
define_method(:model_name) { ActiveModel::Name.new(self, nil, name) }
|
@@ -43,7 +43,7 @@ module SlimFormObject
|
|
43
43
|
|
44
44
|
def get_main_models_from_structure(structure)
|
45
45
|
structure.keys.map do |main_model_name|
|
46
|
-
get_class_of(main_model_name)
|
46
|
+
get_class_of(main_model_name, base_modules[main_model_name])
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
@@ -79,7 +79,8 @@ module SlimFormObject
|
|
79
79
|
|
80
80
|
def initialize(params: {})
|
81
81
|
require_extensions
|
82
|
-
self.
|
82
|
+
self.base_modules = self.class.base_modules
|
83
|
+
self.params = params
|
83
84
|
get_or_add_default_objects
|
84
85
|
default_settings
|
85
86
|
end
|
@@ -140,7 +141,8 @@ module SlimFormObject
|
|
140
141
|
end unless respond_to?(:allow_to_save_object_block)
|
141
142
|
|
142
143
|
define_singleton_method(:allow_object_processing_block) do
|
143
|
-
Proc.new { |data_object| data_object.blank_or_empty? }
|
144
|
+
# Proc.new { |data_object| data_object.blank_or_empty? }
|
145
|
+
Proc.new { |data_object| true }
|
144
146
|
end unless respond_to?(:allow_object_processing_block)
|
145
147
|
end
|
146
148
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: slim_form_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- woodcrust
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|