Anyone using to_xml and procs...

I'm looking for comments on http://dev.rubyonrails.org/ticket/10162

In my opinion, the current behaviour is a bug, and should be fixed.
If you have a use case where passing procs to the child associations
is actually useful, chime in.

Jonathan del Strother

Calling all folks using to_xml with a block -- what do you think?

jeremy

How about something like this instead (that still prevents the top-
level :procs options from being passed on to associations)?

    posts_proc = Proc.new { |options| options[:builder].tag!
('copyright', 'DHH') }
    xml = authors(:david).to_xml(
      :indent => 2,
      :include => {
        :posts => { :procs => [ posts_proc ] }
      }
    )

See http://dev.rubyonrails.org/ticket/10162#comment:3 for more
details :slight_smile:

Cheers,
Chu Yeow