lib/representable/coercion.rb in representable-1.7.7 vs lib/representable/coercion.rb in representable-1.8.0

- old
+ new

@@ -26,10 +26,10 @@ return super unless options[:type] representable_attrs.inheritable_array(:coercer_class).first.attribute(name, options[:type]) # By using :getter we "pre-occupy" this directive, but we avoid creating accessors, which i find is the cleaner way. - options[:decorator_scope] = true + options[:exec_context] = :decorator options[:getter] = lambda { |*| coercer.coerce(name, represented.send(name)) } options[:setter] = lambda { |v,*| represented.send("#{name}=", coercer.coerce(name, v)) } super end