lib/reform/form/virtual_attributes.rb in reform-0.2.7 vs lib/reform/form/virtual_attributes.rb in reform-1.0.0
- old
+ new
@@ -1,24 +1,22 @@
-module Reform
- class Form
+class Reform::Form < Reform::Contract
# TODO: this should be in Representer namespace.
module EmptyAttributesOptions
def options
empty_fields = representable_attrs.
- find_all { |d| d.options[:empty] }.
+ find_all { |d| d[:empty] }.
collect { |d| d.name.to_sym }
super.exclude!(empty_fields)
end
end
module ReadonlyAttributesOptions
def options
readonly_fields = representable_attrs.
- find_all { |d| d.options[:virtual] }.
+ find_all { |d| d[:virtual] }.
collect { |d| d.name.to_sym }
super.exclude!(readonly_fields)
end
end
- end
end