Fix some to-be-deprecated stuff

This commit is contained in:
Jacques Distler 2010-05-26 14:16:34 -05:00
parent 4b73f1a1ae
commit 1da034e2be
5 changed files with 9 additions and 8 deletions

View file

@ -141,7 +141,7 @@ class AdminController < ApplicationController
private
def is_post
unless (request.post? || ENV["RAILS_ENV"] == "test")
unless (request.post? || Rails.env.test?)
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return false

View file

@ -111,7 +111,7 @@ class FileController < ApplicationController
private
def is_post
unless (request.post? || ENV["RAILS_ENV"] == "test")
unless (request.post? || Rails.env.test?)
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return false

View file

@ -280,7 +280,7 @@ EOL
def save
render(:status => 404, :text => 'Undefined page name', :layout => 'error') and return if @page_name.nil?
unless (request.post? || ENV["RAILS_ENV"] == "test")
unless (request.post? || Rails.env.test?)
headers['Allow'] = 'POST'
render(:status => 405, :text => 'You must use an HTTP POST', :layout => 'error')
return