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.

Add magic encoding comment to generated files

#5759
rails g mailer 'absence/request_mailer' pending

generates such code:

 class Absence::RequestMailer < ActionMailer::Base
  default :from => "from@example.com"

  # Subject can be set in your I18n file at config/locales/en.yml
  # with the following lookup:
  #
  #   en.request_mailer.new.subject
  #
  def pending
    @greeting = "Hi"

    mail :to => "rpa@gavdi.com"
  end

end

The lookup in the comment is invalid in such case. It should be:

en.absence.request_mailer.new.subject

Reported by Robert Pankowecki · October 5th, 2010 @ 02:30 PM

State: committed
Milestone: 3.0.2
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: Low

Activity

  1. Aditya Sanghi
    Aditya Sanghi
    • Assigned user set to Mikel Lindsaar
    • Tag changed from autogenerated, comment, mailer, rails3 to autogenerated, comment, mailer, patch, rails3

    This patch should solve the problem i believe. I couldn't find any tests to test the mailer generator however.

    October 5th, 2010 @ 04:34 PM

  2. Robert Pankowecki
    Robert Pankowecki

    Wow, that was quick fix :-)

    October 5th, 2010 @ 10:59 PM

  3. Ryan Bigg
    Ryan Bigg
    • State changed from new to open
    • Importance changed from to Low

    The generators are in railties/test/generators. Please add a new test class for this in the mailer_generator.rb test file, using the arguments you have passed in to your test-run.

    October 5th, 2010 @ 11:51 PM

  4. Ryan Bigg
    Ryan Bigg
    • Tag changed from autogenerated, comment, mailer, patch, rails3 to mailer, rails3

    October 5th, 2010 @ 11:52 PM

  5. Aditya Sanghi
    Aditya Sanghi

    Thanks for the tip Ryan. I've added a test method in the mailer_generator.rb for checking namespaced mailers. Updated the patch.

    October 6th, 2010 @ 07:44 AM

  6. Aditya Sanghi
    Aditya Sanghi

    Thanks for the tip Ryan. I've added a test method in the mailer_generator.rb for checking namespaced mailers. Updated the patch.

    October 6th, 2010 @ 07:45 AM

  7. Mikel Lindsaar
    Mikel Lindsaar

    Nice checked it out and applying now.

    October 6th, 2010 @ 09:29 AM

  8. Mikel Lindsaar
  9. Mikel Lindsaar
    Mikel Lindsaar
    • State changed from open to committed

    Thanks for your work. I also pushed your changes to master. I merged the last two patches to increase the SNR.

    October 6th, 2010 @ 09:45 AM

  10. Aditya Sanghi
    Aditya Sanghi

    Thanks Mikel,

    I'm still a git white belt. I wonder how one can merge 2 commits into one? ..And i know what SNR stands for too now.

    October 6th, 2010 @ 09:58 AM

  11. Mikel Lindsaar
    Mikel Lindsaar

    Some git master I am sure could teach you, you can squash commits apparently :)

    All I did was manually edit the second patch and voila :)

    October 6th, 2010 @ 10:10 AM

  12. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 10:04 PM

  13. Jeremy Kemper
  14. Ryan Bigg
    Ryan Bigg

    Automatic cleanup of spam.

    October 21st, 2010 @ 03:39 AM

  15. Jeff Kreeftmeijer
  16. Robert Pankowecki
    Robert Pankowecki

    When did the name of the bug changed from "invalid comment generated for namespaced-mailer" ? :-)

    November 22nd, 2010 @ 04:17 PM

  17. bingbing
  18. bingbing
  19. bingbing
  20. links london
  21. juicy
    juicy

    The weather becomes night, a little cool, sat in the room, still open, fan, the wind makes me feel less than that of static terrible night. Don't care about is blown dry ice, is the heart of ice, also.

    April 10th, 2011 @ 09:40 AM

  22. sadie
    sadie

    The weather becomes night, a little cool, sat in the room, still open, fan, the wind makes me feel less than that of static terrible night. Don't care about is blown dry ice, is the heart of ice, also. Newspaper articles

    April 18th, 2011 @ 12:47 PM