Module: Reform::Contract::Validate::NestedValid
- Defined in:
- lib/reform/contract/validate.rb
Instance Method Summary collapse
Instance Method Details
#to_hash ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/reform/contract/validate.rb', line 3 def to_hash(*) nested_forms do |attr| # attr.delete(:prepare) # attr.delete(:extend) attr.merge!( :serialize => lambda { |object, args| # FIXME: merge with Validate::Writer = args..dup [:prefix] = [:prefix].dup # TODO: implement Options#dup. [:prefix] << args.binding.name # FIXME: should be #as. # puts "======= user_options: #{args.user_options.inspect}" object.validate!() # recursively call valid? }, ) end super end |