migrate to Rails 4.0 (closes foodcoops#214)
Conflicts: Gemfile.lock
This commit is contained in:
parent
12d1221bfc
commit
7841245795
97 changed files with 659 additions and 557 deletions
|
|
@ -1,31 +0,0 @@
|
|||
desc "Checks your app and gently warns you if you are using deprecated code."
|
||||
task :deprecated => :environment do
|
||||
deprecated = {
|
||||
'@params' => 'Use params[] instead',
|
||||
'@session' => 'Use session[] instead',
|
||||
'@flash' => 'Use flash[] instead',
|
||||
'@request' => 'Use request[] instead',
|
||||
'@env' => 'Use env[] instead',
|
||||
'find_all\([^_]\|$\)' => 'Use find(:all) instead',
|
||||
'find_first' => 'Use find(:first) instead',
|
||||
'render_partial' => 'Use render :partial instead',
|
||||
'component' => 'Use of components are frowned upon',
|
||||
'paginate' => 'The default paginator is slow. Writing your own may be faster',
|
||||
'start_form_tag' => 'Use form_for instead',
|
||||
'end_form_tag' => 'Use form_for instead',
|
||||
':post => true' => 'Use :method => :post instead'
|
||||
}
|
||||
|
||||
deprecated.each do |key, warning|
|
||||
puts '--> ' + key
|
||||
output = `cd '#{File.expand_path('app', RAILS_ROOT)}' && grep -n --exclude=*.svn* --exclude=.#* -r '#{key}' *`
|
||||
unless output =~ /^$/
|
||||
puts " !! " + warning + " !!"
|
||||
puts ' ' + '.' * (warning.length + 6)
|
||||
puts output
|
||||
else
|
||||
puts " Clean! Cheers for you!"
|
||||
end
|
||||
puts
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue