granite-form 0.4.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +1 -1
- data/.github/workflows/ruby.yml +3 -5
- data/.rubocop.yml +26 -48
- data/.rubocop_todo.yml +304 -27
- data/Appraisals +1 -1
- data/CHANGELOG.md +15 -2
- data/gemfiles/{rails.5.0.gemfile → rails.7.1.gemfile} +3 -3
- data/granite-form.gemspec +6 -5
- data/lib/granite/form/active_record/associations.rb +4 -3
- data/lib/granite/form/config.rb +1 -1
- data/lib/granite/form/errors.rb +34 -32
- data/lib/granite/form/extensions.rb +2 -1
- data/lib/granite/form/model/associations/base.rb +6 -2
- data/lib/granite/form/model/associations/collection/embedded.rb +1 -1
- data/lib/granite/form/model/associations/collection/proxy.rb +3 -3
- data/lib/granite/form/model/associations/embeds_any.rb +1 -1
- data/lib/granite/form/model/associations/embeds_many.rb +15 -11
- data/lib/granite/form/model/associations/embeds_one.rb +9 -8
- data/lib/granite/form/model/associations/nested_attributes.rb +60 -32
- data/lib/granite/form/model/associations/persistence_adapters/active_record/referenced_proxy.rb +2 -1
- data/lib/granite/form/model/associations/persistence_adapters/active_record.rb +7 -6
- data/lib/granite/form/model/associations/persistence_adapters/base.rb +8 -4
- data/lib/granite/form/model/associations/references_any.rb +1 -1
- data/lib/granite/form/model/associations/references_many.rb +3 -2
- data/lib/granite/form/model/associations/references_one.rb +1 -1
- data/lib/granite/form/model/associations/reflections/base.rb +3 -2
- data/lib/granite/form/model/associations/reflections/embeds_any.rb +4 -4
- data/lib/granite/form/model/associations/reflections/embeds_many.rb +4 -1
- data/lib/granite/form/model/associations/reflections/embeds_one.rb +4 -1
- data/lib/granite/form/model/associations/reflections/references_any.rb +6 -6
- data/lib/granite/form/model/associations/reflections/references_many.rb +1 -1
- data/lib/granite/form/model/associations/reflections/references_one.rb +1 -1
- data/lib/granite/form/model/associations/validations.rb +6 -6
- data/lib/granite/form/model/associations.rb +6 -4
- data/lib/granite/form/model/attributes/attribute.rb +1 -0
- data/lib/granite/form/model/attributes/base.rb +9 -7
- data/lib/granite/form/model/attributes/reference_one.rb +1 -1
- data/lib/granite/form/model/attributes/reflections/base/build_type_definition.rb +2 -1
- data/lib/granite/form/model/attributes/reflections/represents/build_type_definition.rb +2 -2
- data/lib/granite/form/model/attributes/represents.rb +1 -1
- data/lib/granite/form/model/attributes.rb +21 -13
- data/lib/granite/form/model/conventions.rb +1 -1
- data/lib/granite/form/model/persistence.rb +1 -1
- data/lib/granite/form/model/primary.rb +1 -1
- data/lib/granite/form/model/representation.rb +4 -4
- data/lib/granite/form/model/scopes.rb +5 -5
- data/lib/granite/form/model/validations.rb +4 -3
- data/lib/granite/form/types/active_support/time_zone.rb +1 -1
- data/lib/granite/form/types/array.rb +1 -1
- data/lib/granite/form/types/big_decimal.rb +1 -1
- data/lib/granite/form/types/boolean.rb +1 -1
- data/lib/granite/form/types/date.rb +1 -1
- data/lib/granite/form/types/date_time.rb +1 -1
- data/lib/granite/form/types/dictionary.rb +1 -1
- data/lib/granite/form/types/float.rb +1 -1
- data/lib/granite/form/types/has_subtype.rb +1 -0
- data/lib/granite/form/types/hash_with_action_controller_parameters.rb +2 -2
- data/lib/granite/form/types/integer.rb +1 -1
- data/lib/granite/form/types/object.rb +2 -1
- data/lib/granite/form/types/string.rb +1 -1
- data/lib/granite/form/types/time.rb +1 -1
- data/lib/granite/form/types/uuid.rb +1 -1
- data/lib/granite/form/util.rb +1 -1
- data/lib/granite/form/version.rb +1 -1
- data/spec/granite/form/active_record/associations_spec.rb +35 -13
- data/spec/granite/form/config_spec.rb +8 -4
- data/spec/granite/form/model/associations/embeds_many_spec.rb +99 -51
- data/spec/granite/form/model/associations/embeds_one_spec.rb +48 -25
- data/spec/granite/form/model/associations/persistence_adapters/active_record_spec.rb +12 -7
- data/spec/granite/form/model/associations/references_many_spec.rb +51 -10
- data/spec/granite/form/model/associations/references_one_spec.rb +17 -6
- data/spec/granite/form/model/associations/reflections/embeds_many_spec.rb +51 -16
- data/spec/granite/form/model/associations/reflections/embeds_one_spec.rb +19 -9
- data/spec/granite/form/model/associations/reflections/references_many_spec.rb +67 -15
- data/spec/granite/form/model/associations/reflections/references_one_spec.rb +34 -11
- data/spec/granite/form/model/associations/validations_spec.rb +16 -5
- data/spec/granite/form/model/associations_spec.rb +28 -9
- data/spec/granite/form/model/attributes/attribute_spec.rb +33 -11
- data/spec/granite/form/model/attributes/base_spec.rb +26 -2
- data/spec/granite/form/model/attributes/reflections/attribute_spec.rb +1 -0
- data/spec/granite/form/model/attributes/reflections/base_spec.rb +1 -0
- data/spec/granite/form/model/attributes/reflections/represents/build_type_definition_spec.rb +3 -1
- data/spec/granite/form/model/attributes/reflections/represents_spec.rb +2 -2
- data/spec/granite/form/model/attributes/represents_spec.rb +2 -2
- data/spec/granite/form/model/attributes_spec.rb +76 -36
- data/spec/granite/form/model/dirty_spec.rb +3 -0
- data/spec/granite/form/model/persistence_spec.rb +15 -5
- data/spec/granite/form/model/primary_spec.rb +17 -2
- data/spec/granite/form/model/representation_spec.rb +13 -3
- data/spec/granite/form/model/scopes_spec.rb +8 -3
- data/spec/granite/form/model/validations/associated_spec.rb +20 -6
- data/spec/granite/form/model/validations/nested_spec.rb +30 -14
- data/spec/granite/form/model/validations_spec.rb +1 -1
- data/spec/granite/form/model_spec.rb +1 -0
- data/spec/granite/form/types/collection_spec.rb +2 -1
- data/spec/granite/form/types/date_spec.rb +1 -1
- data/spec/granite/form/types/date_time_spec.rb +0 -2
- data/spec/granite/form/types/dictionary_spec.rb +1 -0
- data/spec/granite/form/types/has_subtype_spec.rb +6 -1
- data/spec/granite/form/types/hash_with_action_controller_parameters_spec.rb +1 -1
- data/spec/granite/form/types/object_spec.rb +2 -0
- data/spec/granite/form/types/time_spec.rb +0 -2
- data/spec/granite/form/util_spec.rb +6 -3
- data/spec/support/active_record.rb +13 -0
- data/spec/support/shared/nested_attribute_examples.rb +110 -54
- metadata +28 -16
- data/gemfiles/rails.5.1.gemfile +0 -14
- data/gemfiles/rails.5.2.gemfile +0 -14
@@ -25,17 +25,17 @@ module Granite
|
|
25
25
|
|
26
26
|
def klass
|
27
27
|
@klass ||= if options[:data_source].present?
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
options[:data_source].to_s.constantize
|
29
|
+
else
|
30
|
+
super
|
31
|
+
end
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
alias data_source klass
|
35
35
|
|
36
36
|
def persistence_adapter
|
37
37
|
@persistence_adapter ||= self.class.persistence_adapter(klass)
|
38
|
-
|
38
|
+
.new(data_source, options[:primary_key], @scope_proc)
|
39
39
|
end
|
40
40
|
|
41
41
|
def read_source(object)
|
@@ -9,7 +9,7 @@ module Granite
|
|
9
9
|
run_validations!
|
10
10
|
end
|
11
11
|
|
12
|
-
|
12
|
+
alias validate_ancestry valid_ancestry?
|
13
13
|
|
14
14
|
def invalid_ancestry?
|
15
15
|
!valid_ancestry?
|
@@ -19,16 +19,16 @@ module Granite
|
|
19
19
|
valid_ancestry? || raise_validation_error
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
private
|
23
23
|
|
24
24
|
def validate_nested!
|
25
25
|
association_names.each do |name|
|
26
26
|
association = association(name)
|
27
27
|
invalid_block = if association.reflection.klass.method_defined?(:invalid_ansestry?)
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
->(object) { object.invalid_ansestry? }
|
29
|
+
else
|
30
|
+
->(object) { object.invalid? }
|
31
|
+
end
|
32
32
|
|
33
33
|
Granite::Form::Model::Validations::NestedValidator
|
34
34
|
.validate_nested(self, name, association.target, &invalid_block)
|
@@ -58,6 +58,7 @@ module Granite
|
|
58
58
|
def alias_association(alias_name, association_name)
|
59
59
|
reflection = reflect_on_association(association_name)
|
60
60
|
raise ArgumentError, "Can't alias undefined association `#{attribute_name}` on #{self}" unless reflection
|
61
|
+
|
61
62
|
reflection.class.generate_methods alias_name, generated_associations_methods
|
62
63
|
self._association_aliases = _association_aliases.merge(alias_name.to_sym => reflection.name)
|
63
64
|
reflection
|
@@ -72,7 +73,7 @@ module Granite
|
|
72
73
|
_associations.keys
|
73
74
|
end
|
74
75
|
|
75
|
-
|
76
|
+
private
|
76
77
|
|
77
78
|
def attributes_for_inspect
|
78
79
|
(_associations.map do |name, reflection|
|
@@ -82,7 +83,7 @@ module Granite
|
|
82
83
|
|
83
84
|
def generated_associations_methods
|
84
85
|
@generated_associations_methods ||= const_set(:GeneratedAssociationsMethods, Module.new)
|
85
|
-
|
86
|
+
.tap { |proxy| include proxy }
|
86
87
|
end
|
87
88
|
end
|
88
89
|
|
@@ -92,15 +93,16 @@ module Granite
|
|
92
93
|
end
|
93
94
|
end
|
94
95
|
|
95
|
-
|
96
|
+
alias eql? ==
|
96
97
|
|
97
98
|
def association(name)
|
98
99
|
reflection = self.class.reflect_on_association(name)
|
99
100
|
return unless reflection
|
101
|
+
|
100
102
|
(@_associations ||= {})[reflection.name] ||= reflection.build_association(self)
|
101
103
|
end
|
102
104
|
|
103
|
-
|
105
|
+
private
|
104
106
|
|
105
107
|
def attributes_for_inspect
|
106
108
|
(association_names.map do |name|
|
@@ -4,6 +4,7 @@ module Granite
|
|
4
4
|
module Attributes
|
5
5
|
class Base
|
6
6
|
attr_reader :type_definition
|
7
|
+
|
7
8
|
delegate :type, :reflection, :owner, :enum, to: :type_definition
|
8
9
|
delegate :name, :readonly, to: :reflection
|
9
10
|
|
@@ -20,6 +21,7 @@ module Granite
|
|
20
21
|
|
21
22
|
def write(value)
|
22
23
|
return if readonly?
|
24
|
+
|
23
25
|
write_value value
|
24
26
|
end
|
25
27
|
|
@@ -57,12 +59,12 @@ module Granite
|
|
57
59
|
|
58
60
|
def inspect_attribute
|
59
61
|
value = case read
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
when Date, Time, DateTime
|
63
|
+
%("#{read.to_formatted_s(:db)}")
|
64
|
+
else
|
65
|
+
inspection = read.inspect
|
66
|
+
inspection.size > 100 ? inspection.truncate(50) : inspection
|
67
|
+
end
|
66
68
|
"#{name}: #{value}"
|
67
69
|
end
|
68
70
|
|
@@ -89,7 +91,7 @@ module Granite
|
|
89
91
|
end
|
90
92
|
end
|
91
93
|
|
92
|
-
|
94
|
+
private
|
93
95
|
|
94
96
|
def remove_variable(*names)
|
95
97
|
names.flatten.each do |name|
|
@@ -6,6 +6,7 @@ module Granite
|
|
6
6
|
class Base
|
7
7
|
class BuildTypeDefinition
|
8
8
|
attr_reader :owner, :reflection
|
9
|
+
|
9
10
|
delegate :name, to: :reflection
|
10
11
|
|
11
12
|
def initialize(owner, reflection)
|
@@ -19,7 +20,7 @@ module Granite
|
|
19
20
|
type_definition_for(type)
|
20
21
|
end
|
21
22
|
|
22
|
-
|
23
|
+
private
|
23
24
|
|
24
25
|
def type
|
25
26
|
reflection.options[:type]
|
@@ -19,7 +19,7 @@ module Granite
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
private
|
23
23
|
|
24
24
|
def reference
|
25
25
|
owner.__send__(reflection.reference)
|
@@ -61,7 +61,7 @@ module Granite
|
|
61
61
|
|
62
62
|
def convert_active_model_type_to_definition(attribute_type)
|
63
63
|
type = attribute_type.try(:value_class) ||
|
64
|
-
|
64
|
+
Associations::PersistenceAdapters::ActiveRecord::TYPES[attribute_type.type&.to_sym]
|
65
65
|
type_definition_for(type) if type
|
66
66
|
end
|
67
67
|
end
|
@@ -25,7 +25,8 @@ module Granite
|
|
25
25
|
|
26
26
|
%w[attribute collection dictionary].each do |kind|
|
27
27
|
define_singleton_method kind do |*args, &block|
|
28
|
-
add_attribute("Granite::Form::Model::Attributes::Reflections::#{kind.camelize}".constantize, *args,
|
28
|
+
add_attribute("Granite::Form::Model::Attributes::Reflections::#{kind.camelize}".constantize, *args,
|
29
|
+
&block)
|
29
30
|
end
|
30
31
|
end
|
31
32
|
end
|
@@ -34,7 +35,7 @@ module Granite
|
|
34
35
|
def add_attribute(reflection_class, *args, &block)
|
35
36
|
reflection = reflection_class.build(self, generated_attributes_methods, *args, &block)
|
36
37
|
self._attributes = _attributes.merge(reflection.name => reflection)
|
37
|
-
should_define_dirty =
|
38
|
+
should_define_dirty = dirty? && reflection_class != Granite::Form::Model::Attributes::Reflections::Base
|
38
39
|
define_dirty(reflection.name, generated_attributes_methods) if should_define_dirty
|
39
40
|
reflection
|
40
41
|
end
|
@@ -42,7 +43,12 @@ module Granite
|
|
42
43
|
def alias_attribute(alias_name, attribute_name)
|
43
44
|
reflection = reflect_on_attribute(attribute_name)
|
44
45
|
raise ArgumentError, "Unable to alias undefined attribute `#{attribute_name}` on #{self}" unless reflection
|
45
|
-
|
46
|
+
|
47
|
+
if reflection.class == Granite::Form::Model::Attributes::Reflections::Base
|
48
|
+
raise ArgumentError,
|
49
|
+
"Unable to alias base attribute `#{attribute_name}`"
|
50
|
+
end
|
51
|
+
|
46
52
|
reflection.class.generate_methods alias_name, generated_attributes_methods
|
47
53
|
self._attribute_aliases = _attribute_aliases.merge(alias_name.to_s => reflection.name)
|
48
54
|
define_dirty alias_name, generated_attributes_methods if dirty?
|
@@ -85,7 +91,7 @@ module Granite
|
|
85
91
|
self._sanitize = previous_sanitize
|
86
92
|
end
|
87
93
|
|
88
|
-
|
94
|
+
private
|
89
95
|
|
90
96
|
def original_inspect
|
91
97
|
Object.method(:inspect).unbind.bind(self).call
|
@@ -101,7 +107,7 @@ module Granite
|
|
101
107
|
def generated_attributes_methods
|
102
108
|
@generated_attributes_methods ||=
|
103
109
|
const_set(:GeneratedAttributesMethods, Module.new)
|
104
|
-
|
110
|
+
.tap { |proxy| include proxy }
|
105
111
|
end
|
106
112
|
|
107
113
|
def inverted_attribute_aliases
|
@@ -117,14 +123,15 @@ module Granite
|
|
117
123
|
end
|
118
124
|
|
119
125
|
def ==(other)
|
120
|
-
super || other.instance_of?(self.class) && other.attributes(false) == attributes(false)
|
126
|
+
super || (other.instance_of?(self.class) && other.attributes(false) == attributes(false))
|
121
127
|
end
|
122
128
|
|
123
|
-
|
129
|
+
alias eql? ==
|
124
130
|
|
125
131
|
def attribute(name)
|
126
132
|
reflection = self.class.reflect_on_attribute(name)
|
127
133
|
return unless reflection
|
134
|
+
|
128
135
|
initial_value = @initial_attributes.to_h.fetch(reflection.name, Granite::Form::UNDEFINED)
|
129
136
|
@_attributes ||= {}
|
130
137
|
@_attributes[reflection.name] ||= reflection.build_attribute(self, initial_value)
|
@@ -134,13 +141,13 @@ module Granite
|
|
134
141
|
attribute(name).write(value)
|
135
142
|
end
|
136
143
|
|
137
|
-
|
144
|
+
alias []= write_attribute
|
138
145
|
|
139
146
|
def read_attribute(name)
|
140
147
|
attribute(name).read
|
141
148
|
end
|
142
149
|
|
143
|
-
|
150
|
+
alias [] read_attribute
|
144
151
|
|
145
152
|
def read_attribute_before_type_cast(name)
|
146
153
|
attribute(name).read_before_type_cast
|
@@ -162,7 +169,7 @@ module Granite
|
|
162
169
|
assign_attributes(attrs)
|
163
170
|
end
|
164
171
|
|
165
|
-
|
172
|
+
alias update_attributes update
|
166
173
|
|
167
174
|
def assign_attributes(attrs)
|
168
175
|
attrs.each do |name, value|
|
@@ -172,12 +179,13 @@ module Granite
|
|
172
179
|
if respond_to?("#{name}=") && !sanitize_value
|
173
180
|
public_send("#{name}=", value)
|
174
181
|
else
|
175
|
-
|
182
|
+
attribute_type = sanitize_value ? 'primary' : 'undefined'
|
183
|
+
logger.debug("Ignoring #{attribute_type} `#{name}` attribute value for #{self} during mass-assignment")
|
176
184
|
end
|
177
185
|
end
|
178
186
|
end
|
179
187
|
|
180
|
-
|
188
|
+
alias attributes= assign_attributes
|
181
189
|
|
182
190
|
def sync_attributes
|
183
191
|
attribute_names.each do |name|
|
@@ -198,7 +206,7 @@ module Granite
|
|
198
206
|
super
|
199
207
|
end
|
200
208
|
|
201
|
-
|
209
|
+
private
|
202
210
|
|
203
211
|
def attributes_for_inspect
|
204
212
|
attribute_names(false).map do |name|
|
@@ -29,7 +29,7 @@ module Granite
|
|
29
29
|
alias_attribute :primary_attribute, _primary_name
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
alias primary_attribute primary
|
33
33
|
|
34
34
|
def has_primary_attribute? # rubocop:disable Naming/PredicateName
|
35
35
|
has_attribute? _primary_name
|
@@ -19,7 +19,7 @@ module Granite
|
|
19
19
|
attrs = attrs.to_unsafe_hash if attrs.respond_to?(:to_unsafe_hash)
|
20
20
|
attrs = attrs.stringify_keys
|
21
21
|
represented_attrs = self.class.represented_names_and_aliases
|
22
|
-
|
22
|
+
.each_with_object({}) do |name, result|
|
23
23
|
result[name] = attrs.delete(name) if attrs.key?(name)
|
24
24
|
end
|
25
25
|
|
@@ -29,7 +29,7 @@ module Granite
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
|
32
|
+
alias attributes= assign_attributes
|
33
33
|
end
|
34
34
|
|
35
35
|
module ClassMethods
|
@@ -53,9 +53,9 @@ module Granite
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
|
56
|
+
private
|
57
57
|
|
58
|
-
def run_validations!
|
58
|
+
def run_validations! # :nodoc:
|
59
59
|
super
|
60
60
|
emerge_represented_attributes_errors!
|
61
61
|
errors.empty?
|
@@ -26,11 +26,14 @@ module Granite
|
|
26
26
|
|
27
27
|
unless trust && source.is_a?(self.class)
|
28
28
|
source.each do |entity|
|
29
|
-
|
29
|
+
unless entity.is_a?(self.class._scope_model)
|
30
|
+
raise AssociationTypeMismatch.new(self.class._scope_model,
|
31
|
+
entity.class)
|
32
|
+
end
|
30
33
|
end
|
31
34
|
end
|
32
35
|
|
33
|
-
super
|
36
|
+
super(source)
|
34
37
|
end
|
35
38
|
end
|
36
39
|
|
@@ -38,7 +41,6 @@ module Granite
|
|
38
41
|
super || self.class._scope_model.respond_to?(method)
|
39
42
|
end
|
40
43
|
|
41
|
-
# rubocop:disable Style/MethodMissing
|
42
44
|
# rubocop-0.52.1 doesn't understand that `#respond_to_missing?` is defined above
|
43
45
|
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('3.0.0')
|
44
46
|
def method_missing(method, *args, **kwargs, &block)
|
@@ -76,8 +78,6 @@ module Granite
|
|
76
78
|
end
|
77
79
|
end
|
78
80
|
end
|
79
|
-
# rubocop:enable Style/MethodMissing
|
80
|
-
|
81
81
|
def with_scope
|
82
82
|
previous_scope = self.class._scope_model.current_scope
|
83
83
|
self.class._scope_model.current_scope = self
|
@@ -1,3 +1,6 @@
|
|
1
|
+
require_relative 'validations/nested'
|
2
|
+
require_relative 'validations/associated'
|
3
|
+
|
1
4
|
module Granite
|
2
5
|
module Form
|
3
6
|
module Model
|
@@ -22,7 +25,7 @@ module Granite
|
|
22
25
|
valid?(context) || raise_validation_error
|
23
26
|
end
|
24
27
|
|
25
|
-
|
28
|
+
protected
|
26
29
|
|
27
30
|
def raise_validation_error
|
28
31
|
raise Granite::Form::ValidationError, self
|
@@ -31,5 +34,3 @@ module Granite
|
|
31
34
|
end
|
32
35
|
end
|
33
36
|
end
|
34
|
-
|
35
|
-
Dir[File.dirname(__FILE__) + '/validations/*.rb'].each { |file| require file }
|
@@ -4,13 +4,13 @@ module Granite
|
|
4
4
|
module Form
|
5
5
|
module Types
|
6
6
|
class HashWithActionControllerParameters < Object
|
7
|
-
|
7
|
+
private
|
8
8
|
|
9
9
|
def typecast(value)
|
10
10
|
case value
|
11
11
|
when ActionController::Parameters
|
12
12
|
value.to_h if value.permitted?
|
13
|
-
when ::Hash
|
13
|
+
when ::Hash
|
14
14
|
value
|
15
15
|
end
|
16
16
|
end
|
@@ -5,6 +5,7 @@ module Granite
|
|
5
5
|
module Types
|
6
6
|
class Object
|
7
7
|
attr_reader :reflection, :owner, :type
|
8
|
+
|
8
9
|
delegate :name, to: :reflection
|
9
10
|
|
10
11
|
def initialize(type, reflection, owner)
|
@@ -34,7 +35,7 @@ module Granite
|
|
34
35
|
end.to_set
|
35
36
|
end
|
36
37
|
|
37
|
-
|
38
|
+
private
|
38
39
|
|
39
40
|
def ensure_type(value)
|
40
41
|
if value.instance_of?(type)
|
data/lib/granite/form/util.rb
CHANGED
data/lib/granite/form/version.rb
CHANGED