Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
669fd849
R
rails
项目概览
张重言
/
rails
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rails
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
669fd849
编写于
5月 29, 2009
作者:
J
Joshua Peek
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
AS::Concern redefines "include" to lazy include modules as dependencies
上级
c7c35be8
变更
21
隐藏空白更改
内联
并排
Showing
21 changed file
with
31 addition
and
31 deletion
+31
-31
actionpack/lib/action_controller/abstract/benchmarker.rb
actionpack/lib/action_controller/abstract/benchmarker.rb
+1
-1
actionpack/lib/action_controller/abstract/callbacks.rb
actionpack/lib/action_controller/abstract/callbacks.rb
+1
-1
actionpack/lib/action_controller/abstract/helpers.rb
actionpack/lib/action_controller/abstract/helpers.rb
+1
-1
actionpack/lib/action_controller/abstract/layouts.rb
actionpack/lib/action_controller/abstract/layouts.rb
+1
-1
actionpack/lib/action_controller/abstract/renderer.rb
actionpack/lib/action_controller/abstract/renderer.rb
+1
-1
actionpack/lib/action_controller/base/chained/flash.rb
actionpack/lib/action_controller/base/chained/flash.rb
+1
-1
actionpack/lib/action_controller/base/filter_parameter_logging.rb
...ck/lib/action_controller/base/filter_parameter_logging.rb
+2
-4
actionpack/lib/action_controller/base/request_forgery_protection.rb
.../lib/action_controller/base/request_forgery_protection.rb
+1
-1
actionpack/lib/action_controller/base/streaming.rb
actionpack/lib/action_controller/base/streaming.rb
+1
-1
actionpack/lib/action_controller/base/verification.rb
actionpack/lib/action_controller/base/verification.rb
+1
-1
actionpack/lib/action_controller/new_base/conditional_get.rb
actionpack/lib/action_controller/new_base/conditional_get.rb
+1
-1
actionpack/lib/action_controller/new_base/helpers.rb
actionpack/lib/action_controller/new_base/helpers.rb
+1
-1
actionpack/lib/action_controller/new_base/layouts.rb
actionpack/lib/action_controller/new_base/layouts.rb
+2
-2
actionpack/lib/action_controller/new_base/render_options.rb
actionpack/lib/action_controller/new_base/render_options.rb
+5
-5
actionpack/lib/action_controller/new_base/renderer.rb
actionpack/lib/action_controller/new_base/renderer.rb
+1
-1
actionpack/lib/action_controller/new_base/session.rb
actionpack/lib/action_controller/new_base/session.rb
+1
-1
actionpack/lib/action_controller/new_base/testing.rb
actionpack/lib/action_controller/new_base/testing.rb
+1
-1
actionpack/lib/action_controller/new_base/url_for.rb
actionpack/lib/action_controller/new_base/url_for.rb
+1
-1
activerecord/lib/active_record/validations.rb
activerecord/lib/active_record/validations.rb
+2
-2
activesupport/lib/active_support/concern.rb
activesupport/lib/active_support/concern.rb
+2
-0
activesupport/test/concern_test.rb
activesupport/test/concern_test.rb
+3
-3
未找到文件。
actionpack/lib/action_controller/abstract/benchmarker.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module AbstractController
module
Benchmarker
extend
ActiveSupport
::
Concern
depends_on
Logger
include
Logger
module
ClassMethods
def
benchmark
(
title
,
log_level
=
::
Logger
::
DEBUG
,
use_silence
=
true
)
...
...
actionpack/lib/action_controller/abstract/callbacks.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module AbstractController
module
Callbacks
extend
ActiveSupport
::
Concern
depends_on
ActiveSupport
::
NewCallbacks
include
ActiveSupport
::
NewCallbacks
included
do
define_callbacks
:process_action
,
"response_body"
...
...
actionpack/lib/action_controller/abstract/helpers.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module AbstractController
module
Helpers
extend
ActiveSupport
::
Concern
depends_on
Renderer
include
Renderer
included
do
extlib_inheritable_accessor
:master_helper_module
...
...
actionpack/lib/action_controller/abstract/layouts.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module AbstractController
module
Layouts
extend
ActiveSupport
::
Concern
depends_on
Renderer
include
Renderer
included
do
extlib_inheritable_accessor
:_layout_conditions
...
...
actionpack/lib/action_controller/abstract/renderer.rb
浏览文件 @
669fd849
...
...
@@ -4,7 +4,7 @@ module AbstractController
module
Renderer
extend
ActiveSupport
::
Concern
depends_on
AbstractController
::
Logger
include
AbstractController
::
Logger
included
do
attr_internal
:formats
...
...
actionpack/lib/action_controller/base/chained/flash.rb
浏览文件 @
669fd849
...
...
@@ -29,7 +29,7 @@ module Flash
extend
ActiveSupport
::
Concern
# TODO : Remove the defined? check when new base is the main base
depends_on
Session
if
defined?
(
ActionController
::
Http
)
include
Session
if
defined?
(
ActionController
::
Http
)
included
do
# TODO : Remove the defined? check when new base is the main base
...
...
actionpack/lib/action_controller/base/filter_parameter_logging.rb
浏览文件 @
669fd849
...
...
@@ -4,13 +4,11 @@ module FilterParameterLogging
# TODO : Remove the defined? check when new base is the main base
if
defined?
(
ActionController
::
Http
)
depends_on
AbstractController
::
Logger
include
AbstractController
::
Logger
end
included
do
if
defined?
(
ActionController
::
Http
)
include
InstanceMethodsForNewBase
end
include
InstanceMethodsForNewBase
end
module
ClassMethods
...
...
actionpack/lib/action_controller/base/request_forgery_protection.rb
浏览文件 @
669fd849
...
...
@@ -7,7 +7,7 @@ module RequestForgeryProtection
# TODO : Remove the defined? check when new base is the main base
if
defined?
(
ActionController
::
Http
)
depends_on
AbstractController
::
Helpers
,
Session
include
AbstractController
::
Helpers
,
Session
end
included
do
...
...
actionpack/lib/action_controller/base/streaming.rb
浏览文件 @
669fd849
...
...
@@ -6,7 +6,7 @@ module Streaming
# TODO : Remove the defined? check when new base is the main base
if
defined?
(
ActionController
::
Http
)
depends_on
ActionController
::
Renderer
include
ActionController
::
Renderer
end
DEFAULT_SEND_FILE_OPTIONS
=
{
...
...
actionpack/lib/action_controller/base/verification.rb
浏览文件 @
669fd849
...
...
@@ -4,7 +4,7 @@ module Verification #:nodoc:
# TODO : Remove the defined? check when new base is the main base
if
defined?
(
ActionController
::
Http
)
depends_on
AbstractController
::
Callbacks
,
Session
,
Flash
,
Renderer
include
AbstractController
::
Callbacks
,
Session
,
Flash
,
Renderer
end
# This module provides a class-level method for specifying that certain
...
...
actionpack/lib/action_controller/new_base/conditional_get.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module ActionController
module
ConditionalGet
extend
ActiveSupport
::
Concern
depends_on
RackConvenience
include
RackConvenience
# Sets the etag, last_modified, or both on the response and renders a
# "304 Not Modified" response if the request is already fresh.
...
...
actionpack/lib/action_controller/new_base/helpers.rb
浏览文件 @
669fd849
...
...
@@ -6,7 +6,7 @@ module ActionController
module
Helpers
extend
ActiveSupport
::
Concern
depends_on
AbstractController
::
Helpers
include
AbstractController
::
Helpers
included
do
# Set the default directory for helpers
...
...
actionpack/lib/action_controller/new_base/layouts.rb
浏览文件 @
669fd849
...
...
@@ -2,8 +2,8 @@ module ActionController
module
Layouts
extend
ActiveSupport
::
Concern
depends_on
ActionController
::
Renderer
depends_on
AbstractController
::
Layouts
include
ActionController
::
Renderer
include
AbstractController
::
Layouts
module
ClassMethods
def
_implied_layout_name
...
...
actionpack/lib/action_controller/new_base/render_options.rb
浏览文件 @
669fd849
...
...
@@ -39,7 +39,7 @@ def render_to_body(options)
module
RenderOption
#:nodoc:
def
self
.
extended
(
base
)
base
.
extend
ActiveSupport
::
Concern
base
.
depends_on
::
ActionController
::
RenderOptions
base
.
send
:include
,
::
ActionController
::
RenderOptions
def
base
.
register_renderer
(
name
)
included
{
_add_render_option
(
name
)
}
...
...
@@ -94,10 +94,10 @@ def _render_update(proc, options)
module
All
extend
ActiveSupport
::
Concern
depends_on
ActionController
::
Renderers
::
Json
depends_on
ActionController
::
Renderers
::
Js
depends_on
ActionController
::
Renderers
::
Xml
depends_on
ActionController
::
Renderers
::
RJS
include
ActionController
::
Renderers
::
Json
include
ActionController
::
Renderers
::
Js
include
ActionController
::
Renderers
::
Xml
include
ActionController
::
Renderers
::
RJS
end
end
end
actionpack/lib/action_controller/new_base/renderer.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module ActionController
module
Renderer
extend
ActiveSupport
::
Concern
depends_on
AbstractController
::
Renderer
include
AbstractController
::
Renderer
def
process_action
(
*
)
self
.
formats
=
request
.
formats
.
map
{
|
x
|
x
.
to_sym
}
...
...
actionpack/lib/action_controller/new_base/session.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module ActionController
module
Session
extend
ActiveSupport
::
Concern
depends_on
RackConvenience
include
RackConvenience
def
session
@_request
.
session
...
...
actionpack/lib/action_controller/new_base/testing.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module ActionController
module
Testing
extend
ActiveSupport
::
Concern
depends_on
RackConvenience
include
RackConvenience
# OMG MEGA HAX
def
process_with_new_base_test
(
request
,
response
)
...
...
actionpack/lib/action_controller/new_base/url_for.rb
浏览文件 @
669fd849
...
...
@@ -2,7 +2,7 @@ module ActionController
module
UrlFor
extend
ActiveSupport
::
Concern
depends_on
RackConvenience
include
RackConvenience
def
process_action
(
*
)
initialize_current_url
...
...
activerecord/lib/active_record/validations.rb
浏览文件 @
669fd849
...
...
@@ -102,8 +102,8 @@ def generate_message(attribute, message = :invalid, options = {})
module
Validations
extend
ActiveSupport
::
Concern
depends_on
ActiveSupport
::
Callbacks
depends_on
ActiveModel
::
Validations
include
ActiveSupport
::
Callbacks
include
ActiveModel
::
Validations
included
do
alias_method_chain
:save
,
:validation
...
...
activesupport/lib/active_support/concern.rb
浏览文件 @
669fd849
...
...
@@ -19,5 +19,7 @@ def included(base = nil, &block)
super
end
end
alias_method
:include
,
:depends_on
end
end
activesupport/test/concern_test.rb
浏览文件 @
669fd849
...
...
@@ -34,7 +34,7 @@ def baz
module
Bar
extend
ActiveSupport
::
Concern
depends_on
Baz
include
Baz
def
bar
"bar"
...
...
@@ -48,7 +48,7 @@ def baz
module
Foo
extend
ActiveSupport
::
Concern
depends_on
Bar
,
Baz
include
Bar
,
Baz
end
def
setup
...
...
@@ -90,7 +90,7 @@ def test_modules_dependencies_are_met
assert
@klass
.
included_modules
.
include?
(
ConcernTest
::
Bar
)
end
def
test_depend
s_on
_with_multiple_modules
def
test_depend
encies
_with_multiple_modules
@klass
.
send
(
:include
,
Foo
)
assert_equal
[
ConcernTest
::
Foo
,
ConcernTest
::
Bar
,
ConcernTest
::
Baz
::
InstanceMethods
,
ConcernTest
::
Baz
],
@klass
.
included_modules
[
0
..
3
]
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录