Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

'send_on' should be 'sent_on' #17

Merged
merged 1 commit into from

2 participants

Mike Boone Ryan Bigg
Mike Boone

In the recent commit, the function name does not match the attribute it is searching for. I adjusted this and added a missing test. I also discovered that :date works in lieu of :sent_on in Rails 3, so I added that info.

Ryan Bigg radar merged commit decddca into from
Ryan Bigg
Collaborator

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 12 additions and 5 deletions.
  1. +5 −5 lib/application_checker.rb
  2. +7 −0 test/application_checker_test.rb
10 lib/application_checker.rb
View
@@ -343,16 +343,16 @@ def check_old_session_setting
end
end
- #Check for old ActionMailer :send_on attributes
- def check_old_action_mailer_send_on_setting
+ #Check for old ActionMailer :sent_on attributes
+ def check_old_action_mailer_sent_on_setting
files = []
- lines = grep_for("@sent_on", "app/*")
+ lines = grep_for("sent_on", "app/*")
files += extract_filenames(lines) || []
unless files.empty?
alert(
- "Deprecated ActionMailer attribute :send_on",
- "This is deprecated without replace.",
+ "Deprecated ActionMailer attribute :sent_on",
+ "Using the new mailer API, you can specify :date to the mail method.",
"http://stackoverflow.com/questions/7367185/weird-error-when-delivering-mail-undefined-method-index-for-2011-09-09-2215",
files
)
7 test/application_checker_test.rb
View
@@ -311,6 +311,13 @@ def test_check_old_ajax_helpers_empty
assert ! @checker.alerts.has_key?("Deprecated AJAX helper calls")
end
+ def test_check_old_action_mailer_sent_on_setting
+ make_file("app/models", "mailer.rb", "sent_on Time.now")
+ @checker.check_old_action_mailer_sent_on_setting
+
+ assert @checker.alerts.has_key?("Deprecated ActionMailer attribute :sent_on")
+ end
+
def teardown
clear_files
Something went wrong with that request. Please try again.