This project is archived and is in readonly mode.

#5704 ✓stale
Todd Eichel

Docs around belongs_to with :touch don't match code

Reported by Todd Eichel | September 26th, 2010 @ 12:32 AM | in 2.3.10

The documentation states:

If you specify a symbol, that attribute will be updated with the current time instead of the updated_at/on attribute.

However, the touch method actually invokes save! which will update updated_at no matter what. I checked the Rails 3 docs and they've been updated to reflect this. The attached patch fixes it for 2-3-stable, and I included a test case to document the behavior.

Note: the patch file is 7.8MB? I followed the instructions in the contributor guide to generate it. This is what it's supposed to be: http://github.com/tfe/rails/commit/1dad1b6c6de53910c110d79800bd2c6e....

Comments and changes to this ticket

  • Todd Eichel

    Todd Eichel September 26th, 2010 @ 12:35 AM

    • Title changed from “Docs around belongs_to with :touch don't match code” to “[PATCH] Docs around belongs_to with :touch don't match code”
  • Rohit Arondekar

    Rohit Arondekar September 26th, 2010 @ 03:07 AM

    • Importance changed from “” to “Low”

    I think you did git rebase master instead of git rebase origin/2-3-stable. Can you please re-attach the patch or maybe make a pull request — and link to this ticket from there?

  • Todd Eichel

    Todd Eichel September 26th, 2010 @ 03:14 AM

    Here we go... I think the guide incorrectly says to format-patch against master, when it should be against whatever branch you're patching.

  • Rohit Arondekar

    Rohit Arondekar September 26th, 2010 @ 03:18 AM

    • State changed from “new” to “open”
    • Milestone set to 2.3.10
    • Assigned user set to “José Valim”
  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer October 10th, 2010 @ 08:10 PM

    • Title changed from “[PATCH] Docs around belongs_to with :touch don't match code” to “Docs around belongs_to with :touch don't match code”
    • Tag changed from 2.3.x, belongs_to, touch to 2.3.x, belongs_to, patch, touch

    Using the "patch" tag instead of prefixing the ticket title with "[PATCH]" to make sure patched tickets end up in the open patches bin. :)

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:30 PM

    • Tag changed from 2.3.x, belongs_to, patch, touch to 23x, belongs_to, patch, touch

    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.

  • Santiago Pastorino

    Santiago Pastorino February 2nd, 2011 @ 04:30 PM

    • State changed from “open” to “stale”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages