granite-form 0.5.0 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +26 -48
  3. data/.rubocop_todo.yml +304 -27
  4. data/CHANGELOG.md +14 -2
  5. data/granite-form.gemspec +2 -1
  6. data/lib/granite/form/active_record/associations.rb +4 -3
  7. data/lib/granite/form/config.rb +1 -1
  8. data/lib/granite/form/errors.rb +34 -32
  9. data/lib/granite/form/extensions.rb +2 -1
  10. data/lib/granite/form/model/associations/base.rb +6 -2
  11. data/lib/granite/form/model/associations/collection/embedded.rb +1 -1
  12. data/lib/granite/form/model/associations/collection/proxy.rb +3 -3
  13. data/lib/granite/form/model/associations/embeds_any.rb +1 -1
  14. data/lib/granite/form/model/associations/embeds_many.rb +15 -11
  15. data/lib/granite/form/model/associations/embeds_one.rb +9 -8
  16. data/lib/granite/form/model/associations/nested_attributes.rb +60 -32
  17. data/lib/granite/form/model/associations/persistence_adapters/active_record/referenced_proxy.rb +2 -1
  18. data/lib/granite/form/model/associations/persistence_adapters/active_record.rb +7 -6
  19. data/lib/granite/form/model/associations/persistence_adapters/base.rb +8 -4
  20. data/lib/granite/form/model/associations/references_any.rb +1 -1
  21. data/lib/granite/form/model/associations/references_many.rb +3 -2
  22. data/lib/granite/form/model/associations/references_one.rb +1 -1
  23. data/lib/granite/form/model/associations/reflections/base.rb +3 -2
  24. data/lib/granite/form/model/associations/reflections/embeds_any.rb +4 -4
  25. data/lib/granite/form/model/associations/reflections/embeds_many.rb +4 -1
  26. data/lib/granite/form/model/associations/reflections/embeds_one.rb +4 -1
  27. data/lib/granite/form/model/associations/reflections/references_any.rb +6 -6
  28. data/lib/granite/form/model/associations/reflections/references_many.rb +1 -1
  29. data/lib/granite/form/model/associations/reflections/references_one.rb +1 -1
  30. data/lib/granite/form/model/associations/validations.rb +6 -6
  31. data/lib/granite/form/model/associations.rb +6 -4
  32. data/lib/granite/form/model/attributes/attribute.rb +1 -0
  33. data/lib/granite/form/model/attributes/base.rb +9 -7
  34. data/lib/granite/form/model/attributes/reference_one.rb +1 -1
  35. data/lib/granite/form/model/attributes/reflections/base/build_type_definition.rb +2 -1
  36. data/lib/granite/form/model/attributes/reflections/represents/build_type_definition.rb +2 -2
  37. data/lib/granite/form/model/attributes/represents.rb +1 -1
  38. data/lib/granite/form/model/attributes.rb +31 -14
  39. data/lib/granite/form/model/conventions.rb +1 -1
  40. data/lib/granite/form/model/persistence.rb +1 -1
  41. data/lib/granite/form/model/primary.rb +1 -1
  42. data/lib/granite/form/model/representation.rb +4 -4
  43. data/lib/granite/form/model/scopes.rb +5 -5
  44. data/lib/granite/form/model/validations.rb +4 -3
  45. data/lib/granite/form/types/active_support/time_zone.rb +1 -1
  46. data/lib/granite/form/types/array.rb +1 -1
  47. data/lib/granite/form/types/big_decimal.rb +1 -1
  48. data/lib/granite/form/types/boolean.rb +1 -1
  49. data/lib/granite/form/types/date.rb +1 -1
  50. data/lib/granite/form/types/date_time.rb +1 -1
  51. data/lib/granite/form/types/dictionary.rb +1 -1
  52. data/lib/granite/form/types/float.rb +1 -1
  53. data/lib/granite/form/types/has_subtype.rb +1 -0
  54. data/lib/granite/form/types/hash_with_action_controller_parameters.rb +2 -2
  55. data/lib/granite/form/types/integer.rb +1 -1
  56. data/lib/granite/form/types/object.rb +2 -1
  57. data/lib/granite/form/types/string.rb +1 -1
  58. data/lib/granite/form/types/time.rb +1 -1
  59. data/lib/granite/form/types/uuid.rb +1 -1
  60. data/lib/granite/form/util.rb +1 -1
  61. data/lib/granite/form/version.rb +1 -1
  62. data/spec/granite/form/active_record/associations_spec.rb +35 -13
  63. data/spec/granite/form/config_spec.rb +8 -4
  64. data/spec/granite/form/model/associations/embeds_many_spec.rb +99 -51
  65. data/spec/granite/form/model/associations/embeds_one_spec.rb +48 -25
  66. data/spec/granite/form/model/associations/persistence_adapters/active_record_spec.rb +12 -7
  67. data/spec/granite/form/model/associations/references_many_spec.rb +51 -10
  68. data/spec/granite/form/model/associations/references_one_spec.rb +17 -6
  69. data/spec/granite/form/model/associations/reflections/embeds_many_spec.rb +51 -16
  70. data/spec/granite/form/model/associations/reflections/embeds_one_spec.rb +19 -9
  71. data/spec/granite/form/model/associations/reflections/references_many_spec.rb +67 -15
  72. data/spec/granite/form/model/associations/reflections/references_one_spec.rb +34 -11
  73. data/spec/granite/form/model/associations/validations_spec.rb +16 -5
  74. data/spec/granite/form/model/associations_spec.rb +28 -9
  75. data/spec/granite/form/model/attributes/attribute_spec.rb +33 -11
  76. data/spec/granite/form/model/attributes/base_spec.rb +9 -3
  77. data/spec/granite/form/model/attributes/reflections/attribute_spec.rb +1 -0
  78. data/spec/granite/form/model/attributes/reflections/base_spec.rb +1 -0
  79. data/spec/granite/form/model/attributes/reflections/represents/build_type_definition_spec.rb +3 -1
  80. data/spec/granite/form/model/attributes/reflections/represents_spec.rb +2 -2
  81. data/spec/granite/form/model/attributes/represents_spec.rb +2 -2
  82. data/spec/granite/form/model/attributes_spec.rb +97 -36
  83. data/spec/granite/form/model/dirty_spec.rb +3 -0
  84. data/spec/granite/form/model/persistence_spec.rb +15 -5
  85. data/spec/granite/form/model/primary_spec.rb +17 -2
  86. data/spec/granite/form/model/representation_spec.rb +13 -3
  87. data/spec/granite/form/model/scopes_spec.rb +8 -3
  88. data/spec/granite/form/model/validations/associated_spec.rb +20 -6
  89. data/spec/granite/form/model/validations/nested_spec.rb +30 -14
  90. data/spec/granite/form/model/validations_spec.rb +1 -1
  91. data/spec/granite/form/model_spec.rb +1 -0
  92. data/spec/granite/form/types/collection_spec.rb +2 -1
  93. data/spec/granite/form/types/date_spec.rb +1 -1
  94. data/spec/granite/form/types/date_time_spec.rb +0 -2
  95. data/spec/granite/form/types/dictionary_spec.rb +1 -0
  96. data/spec/granite/form/types/has_subtype_spec.rb +6 -1
  97. data/spec/granite/form/types/hash_with_action_controller_parameters_spec.rb +1 -1
  98. data/spec/granite/form/types/object_spec.rb +2 -0
  99. data/spec/granite/form/types/time_spec.rb +0 -2
  100. data/spec/granite/form/util_spec.rb +6 -3
  101. data/spec/support/active_record.rb +13 -0
  102. data/spec/support/shared/nested_attribute_examples.rb +110 -54
  103. metadata +19 -6
  104. data/.github/CODEOWNERS +0 -1
@@ -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
- when Date, Time, DateTime
61
- %("#{read.to_formatted_s(:db)}")
62
- else
63
- inspection = read.inspect
64
- inspection.size > 100 ? inspection.truncate(50) : inspection
65
- end
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
- private
94
+ private
93
95
 
94
96
  def remove_variable(*names)
95
97
  names.flatten.each do |name|
@@ -32,7 +32,7 @@ module Granite
32
32
  @value_cache
33
33
  end
34
34
 
35
- private
35
+ private
36
36
 
37
37
  def association
38
38
  @association ||= owner.association(reflection.association)
@@ -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
- private
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
- private
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
- Associations::PersistenceAdapters::ActiveRecord::TYPES[attribute_type.type&.to_sym]
64
+ Associations::PersistenceAdapters::ActiveRecord::TYPES[attribute_type.type&.to_sym]
65
65
  type_definition_for(type) if type
66
66
  end
67
67
  end
@@ -24,7 +24,7 @@ module Granite
24
24
  end
25
25
  end
26
26
 
27
- private
27
+ private
28
28
 
29
29
  def reference
30
30
  owner.__send__(reflection.reference)
@@ -16,16 +16,20 @@ module Granite
16
16
  extend ActiveSupport::Concern
17
17
 
18
18
  included do
19
- class_attribute :_attributes, :_attribute_aliases, :_sanitize, instance_reader: false, instance_writer: false
19
+ class_attribute :_attributes, :_attribute_aliases, :_sanitize,
20
+ :mass_assignment_strict_mode,
21
+ instance_reader: false, instance_writer: false
20
22
  self._attributes = {}
21
23
  self._attribute_aliases = {}
22
24
  self._sanitize = true
25
+ self.mass_assignment_strict_mode = false
23
26
 
24
27
  delegate :attribute_names, :has_attribute?, to: 'self.class'
25
28
 
26
29
  %w[attribute collection dictionary].each do |kind|
27
30
  define_singleton_method kind do |*args, &block|
28
- add_attribute("Granite::Form::Model::Attributes::Reflections::#{kind.camelize}".constantize, *args, &block)
31
+ add_attribute("Granite::Form::Model::Attributes::Reflections::#{kind.camelize}".constantize, *args,
32
+ &block)
29
33
  end
30
34
  end
31
35
  end
@@ -34,7 +38,7 @@ module Granite
34
38
  def add_attribute(reflection_class, *args, &block)
35
39
  reflection = reflection_class.build(self, generated_attributes_methods, *args, &block)
36
40
  self._attributes = _attributes.merge(reflection.name => reflection)
37
- should_define_dirty = (dirty? && reflection_class != Granite::Form::Model::Attributes::Reflections::Base)
41
+ should_define_dirty = dirty? && reflection_class != Granite::Form::Model::Attributes::Reflections::Base
38
42
  define_dirty(reflection.name, generated_attributes_methods) if should_define_dirty
39
43
  reflection
40
44
  end
@@ -42,7 +46,12 @@ module Granite
42
46
  def alias_attribute(alias_name, attribute_name)
43
47
  reflection = reflect_on_attribute(attribute_name)
44
48
  raise ArgumentError, "Unable to alias undefined attribute `#{attribute_name}` on #{self}" unless reflection
45
- raise ArgumentError, "Unable to alias base attribute `#{attribute_name}`" if reflection.class == Granite::Form::Model::Attributes::Reflections::Base
49
+
50
+ if reflection.class == Granite::Form::Model::Attributes::Reflections::Base
51
+ raise ArgumentError,
52
+ "Unable to alias base attribute `#{attribute_name}`"
53
+ end
54
+
46
55
  reflection.class.generate_methods alias_name, generated_attributes_methods
47
56
  self._attribute_aliases = _attribute_aliases.merge(alias_name.to_s => reflection.name)
48
57
  define_dirty alias_name, generated_attributes_methods if dirty?
@@ -85,7 +94,7 @@ module Granite
85
94
  self._sanitize = previous_sanitize
86
95
  end
87
96
 
88
- private
97
+ private
89
98
 
90
99
  def original_inspect
91
100
  Object.method(:inspect).unbind.bind(self).call
@@ -101,7 +110,7 @@ module Granite
101
110
  def generated_attributes_methods
102
111
  @generated_attributes_methods ||=
103
112
  const_set(:GeneratedAttributesMethods, Module.new)
104
- .tap { |proxy| include proxy }
113
+ .tap { |proxy| include proxy }
105
114
  end
106
115
 
107
116
  def inverted_attribute_aliases
@@ -117,14 +126,15 @@ module Granite
117
126
  end
118
127
 
119
128
  def ==(other)
120
- super || other.instance_of?(self.class) && other.attributes(false) == attributes(false)
129
+ super || (other.instance_of?(self.class) && other.attributes(false) == attributes(false))
121
130
  end
122
131
 
123
- alias_method :eql?, :==
132
+ alias eql? ==
124
133
 
125
134
  def attribute(name)
126
135
  reflection = self.class.reflect_on_attribute(name)
127
136
  return unless reflection
137
+
128
138
  initial_value = @initial_attributes.to_h.fetch(reflection.name, Granite::Form::UNDEFINED)
129
139
  @_attributes ||= {}
130
140
  @_attributes[reflection.name] ||= reflection.build_attribute(self, initial_value)
@@ -134,13 +144,13 @@ module Granite
134
144
  attribute(name).write(value)
135
145
  end
136
146
 
137
- alias_method :[]=, :write_attribute
147
+ alias []= write_attribute
138
148
 
139
149
  def read_attribute(name)
140
150
  attribute(name).read
141
151
  end
142
152
 
143
- alias_method :[], :read_attribute
153
+ alias [] read_attribute
144
154
 
145
155
  def read_attribute_before_type_cast(name)
146
156
  attribute(name).read_before_type_cast
@@ -162,7 +172,7 @@ module Granite
162
172
  assign_attributes(attrs)
163
173
  end
164
174
 
165
- alias_method :update_attributes, :update
175
+ alias update_attributes update
166
176
 
167
177
  def assign_attributes(attrs)
168
178
  attrs.each do |name, value|
@@ -172,12 +182,13 @@ module Granite
172
182
  if respond_to?("#{name}=") && !sanitize_value
173
183
  public_send("#{name}=", value)
174
184
  else
175
- logger.info("Ignoring #{sanitize_value ? 'primary' : 'undefined'} `#{name}` attribute value for #{self} during mass-assignment")
185
+ attribute_type = sanitize_value ? 'primary' : 'undefined'
186
+ report_unknown_attribute(attribute_type, name)
176
187
  end
177
188
  end
178
189
  end
179
190
 
180
- alias_method :attributes=, :assign_attributes
191
+ alias attributes= assign_attributes
181
192
 
182
193
  def sync_attributes
183
194
  attribute_names.each do |name|
@@ -198,7 +209,13 @@ module Granite
198
209
  super
199
210
  end
200
211
 
201
- private
212
+ private
213
+
214
+ def report_unknown_attribute(attribute_type, name)
215
+ raise ActiveModel::UnknownAttributeError.new(self, name.to_s) if self.class.mass_assignment_strict_mode
216
+
217
+ logger.debug("Ignoring #{attribute_type} `#{name}` attribute value for #{self} during mass-assignment")
218
+ end
202
219
 
203
220
  def attributes_for_inspect
204
221
  attribute_names(false).map do |name|
@@ -19,7 +19,7 @@ module Granite
19
19
  !persisted?
20
20
  end
21
21
 
22
- alias_method :new_object?, :new_record?
22
+ alias new_object? new_record?
23
23
 
24
24
  module ClassMethods
25
25
  def i18n_scope
@@ -30,7 +30,7 @@ module Granite
30
30
  false
31
31
  end
32
32
 
33
- private
33
+ private
34
34
 
35
35
  def mark_persisted!
36
36
  @persisted = true
@@ -29,7 +29,7 @@ module Granite
29
29
  alias_attribute :primary_attribute, _primary_name
30
30
  end
31
31
 
32
- alias_method :primary_attribute, :primary
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
- .each_with_object({}) do |name, result|
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
- alias_method :attributes=, :assign_attributes
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
- private
56
+ private
57
57
 
58
- def run_validations! #:nodoc:
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
- raise AssociationTypeMismatch.new(self.class._scope_model, entity.class) unless entity.is_a?(self.class._scope_model)
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 source
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
- protected
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 }
@@ -5,7 +5,7 @@ module Granite
5
5
  module Types
6
6
  module ActiveSupport
7
7
  class TimeZone < Float
8
- private
8
+ private
9
9
 
10
10
  def typecast(value)
11
11
  case value
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class Array < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  if value.is_a?(::String)
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class BigDecimal < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  BigDecimal(Float(value).to_s) if value
@@ -29,7 +29,7 @@ module Granite
29
29
  MAPPING[value]
30
30
  end
31
31
 
32
- private
32
+ private
33
33
 
34
34
  def typecast(value)
35
35
  self.class.typecast(value)
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class Date < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  value.try(:to_date)
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class DateTime < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  value.try(:to_datetime)
@@ -10,7 +10,7 @@ module Granite
10
10
  value.transform_values { |v| subtype_definition.prepare(v) }.with_indifferent_access
11
11
  end
12
12
 
13
- private
13
+ private
14
14
 
15
15
  def to_hash(value)
16
16
  Hash[value]
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class Float < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  Float(value)
@@ -3,6 +3,7 @@ module Granite
3
3
  module Types
4
4
  class HasSubtype
5
5
  attr_reader :subtype_definition
6
+
6
7
  delegate :reflection, :owner, :type, :name, :enum, to: :subtype_definition
7
8
 
8
9
  def initialize(subtype_definition)
@@ -4,13 +4,13 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class HashWithActionControllerParameters < Object
7
- private
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 then
13
+ when ::Hash
14
14
  value
15
15
  end
16
16
  end
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class Integer < Float
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  super.try(:to_i)
@@ -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
- private
38
+ private
38
39
 
39
40
  def ensure_type(value)
40
41
  if value.instance_of?(type)
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class String < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  value.to_s
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class Time < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  value.is_a?(::String) && ::Time.zone ? ::Time.zone.parse(value) : value.try(:to_time)
@@ -4,7 +4,7 @@ module Granite
4
4
  module Form
5
5
  module Types
6
6
  class UUID < Object
7
- private
7
+ private
8
8
 
9
9
  def typecast(value)
10
10
  case value
@@ -41,7 +41,7 @@ module Granite
41
41
  end
42
42
  end
43
43
 
44
- private
44
+ private
45
45
 
46
46
  def evaluate_proc(value, *args)
47
47
  instance_exec(*args, &value)
@@ -1,5 +1,5 @@
1
1
  module Granite
2
2
  module Form
3
- VERSION = '0.5.0'.freeze
3
+ VERSION = '0.6.1'.freeze
4
4
  end
5
5
  end