lib/rest_model/key/property/sender.rb in rest_model-0.1.5 vs lib/rest_model/key/property/sender.rb in rest_model-0.1.6
- old
+ new
@@ -1,10 +1,11 @@
class RestModel
class Property
module Sender
def to_source!(value, resource, options = {})
source_value = begin
- translation.translate_to_source(serializer.desserialize(value), resource)
+ translation.translates_to_source? ? translation.translate_to_source(value, resource)
+ : serializer.desserialize(value)
rescue => exception
raise exception if options[:fail]
end
source = {}