lib/reform/form/coercion.rb in reform-0.2.7 vs lib/reform/form/coercion.rb in reform-1.0.0
- old
+ new
@@ -1,18 +1,17 @@
require 'representable/decorator/coercion'
-class Reform::Form
- module Coercion
- def self.included(base)
- base.extend(ClassMethods)
- end
+module Reform::Form::Coercion
+ def self.included(base)
+ base.extend(ClassMethods)
+ base.features << self
+ end
- module ClassMethods
- def representer_class
- super.class_eval do
- include Representable::Decorator::Coercion unless self < Representable::Decorator::Coercion # DISCUSS: include it once. why do we have to check this?
- self
- end
+ module ClassMethods
+ def representer_class
+ super.class_eval do
+ include Representable::Decorator::Coercion unless self < Representable::Decorator::Coercion # DISCUSS: include it once. why do we have to check this?
+ self
end
end
end
end