提交 91ce8d8b 编写于 作者: D David Heinemeier Hansson

Merge branch 'master' of github.com:rails/rails

......@@ -22,14 +22,13 @@ module ActionController
autoload :HideActions
autoload :Layouts
autoload :MimeResponds
autoload :RackConvenience
autoload :RackDelegation
autoload :Compatibility
autoload :Redirecting
autoload :Rendering
autoload :Renderers
autoload :Rescue
autoload :Responder
autoload :Session
autoload :SessionManagement
autoload :UrlFor
autoload :Verification
......
......@@ -13,7 +13,7 @@ class Base < Metal
include ActionController::Renderers::All
include ActionController::Layouts
include ActionController::ConditionalGet
include ActionController::RackConvenience
include ActionController::RackDelegation
include ActionController::Benchmarking
include ActionController::Configuration
......@@ -26,7 +26,6 @@ class Base < Metal
include ActionController::Compatibility
include ActionController::Cookies
include ActionController::Session
include ActionController::Flash
include ActionController::Verification
include ActionController::RequestForgeryProtection
......
......@@ -45,7 +45,7 @@ def controller_path
# The details below can be overridden to support a specific
# Request and Response object. The default ActionController::Base
# implementation includes RackConvenience, which makes a request
# implementation includes RackDelegation, which makes a request
# and response object available. You might wish to control the
# environment and response manually for performance reasons.
......@@ -57,8 +57,8 @@ def initialize(*)
end
# Basic implementations for content_type=, location=, and headers are
# provided to reduce the dependency on the RackConvenience module
# in Rendering and Redirecting.
# provided to reduce the dependency on the RackDelegation module
# in Renderer and Redirector.
def content_type=(type)
headers["Content-Type"] = type.to_s
......
......@@ -2,7 +2,7 @@ module ActionController
module ConditionalGet
extend ActiveSupport::Concern
include RackConvenience
include RackDelegation
include Head
# Sets the etag, last_modified, or both on the response and renders a
......
......@@ -46,7 +46,7 @@ module ActionController #:nodoc:
module Cookies
extend ActiveSupport::Concern
include RackConvenience
include RackDelegation
included do
helper_method :cookies
......
......@@ -28,8 +28,6 @@ module ActionController #:nodoc:
module Flash
extend ActiveSupport::Concern
include Session
included do
helper_method :alert, :notice
end
......
module ActionController
module RackConvenience
module RackDelegation
extend ActiveSupport::Concern
included do
delegate :session, :reset_session, :to => "@_request"
delegate :headers, :status=, :location=, :content_type=,
:status, :location, :content_type, :to => "@_response"
attr_internal :request
......
......@@ -5,7 +5,7 @@ class InvalidAuthenticityToken < ActionControllerError #:nodoc:
module RequestForgeryProtection
extend ActiveSupport::Concern
include AbstractController::Helpers, Session
include AbstractController::Helpers
included do
# Sets the token parameter name for RequestForgery. Calling +protect_from_forgery+
......
module ActionController
module Session
extend ActiveSupport::Concern
include RackConvenience
def session
@_request.session
end
def reset_session
@_request.reset_session
end
end
end
......@@ -2,7 +2,7 @@ module ActionController
module Testing
extend ActiveSupport::Concern
include RackConvenience
include RackDelegation
# OMG MEGA HAX
def process_with_new_base_test(request, response)
......
......@@ -2,7 +2,7 @@ module ActionController
module UrlFor
extend ActiveSupport::Concern
include RackConvenience
include RackDelegation
# Overwrite to implement a number of default options that all url_for-based methods will use. The default options should come in
# the form of a hash, just like the one you would use for url_for directly. Example:
......
......@@ -2,7 +2,7 @@ module ActionController #:nodoc:
module Verification #:nodoc:
extend ActiveSupport::Concern
include AbstractController::Callbacks, Session, Flash, Rendering
include AbstractController::Callbacks, Flash, Rendering
# This module provides a class-level method for specifying that certain
# actions are guarded against being called without certain prerequisites
......
require 'active_support/duration'
require 'active_support/core_ext/date/acts_like'
require 'active_support/core_ext/date/calculations'
class Time
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册