lib/rice_bubble/attributes/optional.rb in rice_bubble-0.1.2 vs lib/rice_bubble/attributes/optional.rb in rice_bubble-0.2.0
- old
+ new
@@ -7,18 +7,14 @@
super(&)
@child = child
end
def valid?(value)
- value.nil? || child.valid?(child.coerce(value))
+ value.nil? || child.valid?(value)
end
def call(value, path: '')
value && child.call(value, path:)
- end
-
- def coerce(value)
- value && child.coerce(value)
end
def description
"#{child.description} (optional)"
end