Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Delete useless constructor in XML Serializers

#5550

I think this constructor is useless, as to_xml triggers the second constructor, which is working fine.
Jose commited at 29 April with an error in this not used constructor and it has been undetected for few months now.
http://github.com/rails/rails/commit/2e9af3638d950ef840e1287f99e323...

Also, andreas's tests of new patch that fixed this undetected error are wrong, as they use to_xml which triggers other constructor (not that one he fixed).

Reported by Jakub Okoński · September 3rd, 2010 @ 04:57 PM

State: stale
Milestone: none
Assigned to: José Valim José Valim
Importance: Low

Activity

  1. Jakub Okoński
    Jakub Okoński

    Having some problems with lighthouse attachments, here is a patch:
    http://gist.github.com/564092

    September 3rd, 2010 @ 05:00 PM

  2. José Valim
    José Valim
    • Importance changed from to Low

    Awesome! I will apply it later! Thanks!

    September 3rd, 2010 @ 05:44 PM

  3. José Valim
    José Valim

    Why do we need to delete the test? Does it pass or fail after your changes?

    September 18th, 2010 @ 08:19 PM

  4. Jakub Okoński
    Jakub Okoński

    The test is wrong, because it triggers working construcor of XML Serializer. This one, that I call 'useless' is not triggered by any other function, so why keeping it?

    September 19th, 2010 @ 04:19 PM

  5. José Valim
    José Valim

    In any case, Andrea have found an issue. Shouldn't we have a test for the issue he found?

    September 19th, 2010 @ 04:33 PM

  6. Jakub Okoński
    Jakub Okoński

    This test of his is wrong, because it triggers not this function that he fixed, but the other.

    Post.where(:id => 12345).first.to_xml triggers second constructor(def initialize), not the one he fixed.

    I'll try to fix his test and post a patch.

    September 19th, 2010 @ 07:02 PM

  7. Jakub Okoński
    Jakub Okoński

    Please test this one, as my bundler installation is broken someone.

    September 19th, 2010 @ 07:16 PM

  8. Jakub Okoński
  9. José Valim
    José Valim
    • State changed from new to incomplete

    Applying your patch that removes the constructor causes several ActiveModel tests to fail.

    September 24th, 2010 @ 11:45 AM

  10. Santiago Pastorino
    Santiago Pastorino
    • State changed from incomplete to open

    This issue has been automatically marked as stale because it has not been commented on for at least three months.

    The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.

    Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.

    February 2nd, 2011 @ 04:31 PM

  11. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:31 PM