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.

Sent_on should default to now

#2607

Sent_on should default to now in ActionMailer.

Currently it has no default. If you don't set sent_on then your mail will be sent without a date header. This has unpredictable results because although most mail server will insert a date header (defaulting to now) when the date header is missing not all will do so.

Defaulting to Time.now follows the principle of least surprise.

Reported by Joel Chippindale · May 5th, 2009 @ 09:38 AM

State: committed
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Cheah Chu Yeow
    Cheah Chu Yeow

    Patch checks out, all tests pass. +1

    I was initially concerned about the removal of the test for Time.local(2004, 12, 12) but I can see that's already being tested in the other testcases.

    May 12th, 2009 @ 05:53 PM

  2. Grant Hutchins
    Grant Hutchins

    Perhaps using nil for sent_on should give the original behavior.

    June 10th, 2009 @ 10:35 PM

  3. Joel Chippindale
  4. Joel Chippindale
    Joel Chippindale

    This is the behaviour of this patch.

    I've attached a new version of the patch with a test to showing this.

    June 11th, 2009 @ 09:48 AM

  5. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from actionmailer, date, patch to actionmailer, bugmash, date, patch

    August 7th, 2009 @ 02:02 PM

  6. Matt Duncan
    Matt Duncan

    +1 I updated the patch to apply cleanly to the latest 2-3-stable, looks good and all tests pass.

    I've attached a patch.

    August 8th, 2009 @ 02:44 AM

  7. Repository
    Repository
    • State changed from new to committed

    August 8th, 2009 @ 03:11 AM

  8. Repository
  9. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from actionmailer, bugmash, date, patch to actionmailer, date, patch
    • Milestone cleared.

    August 8th, 2009 @ 11:05 PM