Skip to content

Commit

Permalink
add ajax helpers to be removed
Browse files Browse the repository at this point in the history
  • Loading branch information
gmoeck authored and jm committed Feb 18, 2011
1 parent 3c9b3dc commit ed4412a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/application_checker.rb
Expand Up @@ -236,6 +236,25 @@ def check_old_helpers
end
end

# Checks for old-style AJAX helpers
def check_old_ajax_helpers
files = []
['link_to_remote','form_remote_tag','remote_form_for'].each do |type|
lines = grep_for(type, "app/views/**/*")
inner_files = extract_filenames(lines)
files += inner_files unless inner_files.nil?
end

if files
alert(
"Deprecated AJAX helper calls",
"AJAX javascript helpers have been switched to be unobtrusive and use :remote => true instead of having a seperate function to handle remote requests.",
"http://www.themodestrubyist.com/2010/02/24/rails-3-ujs-and-csrf-meta-tags/",
files
)
end
end

# Checks for old cookie secret settings
def check_old_cookie_secret
lines = grep_for("ActionController::Base.cookie_verifier_secret = ", "config/**/*")
Expand Down

0 comments on commit ed4412a

Please sign in to comment.