lib/prezzo/context.rb in prezzo-0.3.0 vs lib/prezzo/context.rb in prezzo-0.3.1
- old
+ new
@@ -16,16 +16,13 @@
validation.errors
end
def fetch(key, default = nil)
if default.nil?
- value = attributes.fetch(key)
+ attributes.fetch(key)
else
- value = attributes.fetch(key, default)
- value = default if value.nil?
+ attributes.fetch(key, default) || default
end
-
- value
end
def attributes
validation.output
end