Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
17c4240e
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,体验更适合开发者的 AI 搜索 >>
未验证
提交
17c4240e
编写于
3月 10, 2019
作者:
K
Kasper Timm Hansen
提交者:
Aaron Patterson
8月 14, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_block
Ruby 2.7 warning: creating a Proc without a block
上级
2dc08f68
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
16 addition
and
16 deletion
+16
-16
actionpack/lib/action_controller/metal.rb
actionpack/lib/action_controller/metal.rb
+2
-2
actionpack/lib/action_dispatch/middleware/stack.rb
actionpack/lib/action_dispatch/middleware/stack.rb
+2
-2
actionview/lib/action_view/helpers/form_helper.rb
actionview/lib/action_view/helpers/form_helper.rb
+2
-2
activerecord/lib/active_record/associations/builder/collection_association.rb
...ive_record/associations/builder/collection_association.rb
+2
-2
activerecord/lib/active_record/scoping/default.rb
activerecord/lib/active_record/scoping/default.rb
+2
-2
activerecord/lib/active_record/statement_cache.rb
activerecord/lib/active_record/statement_cache.rb
+2
-2
activesupport/lib/active_support/notifications/fanout.rb
activesupport/lib/active_support/notifications/fanout.rb
+2
-2
railties/lib/rails/engine.rb
railties/lib/rails/engine.rb
+2
-2
未找到文件。
actionpack/lib/action_controller/metal.rb
浏览文件 @
17c4240e
...
...
@@ -26,10 +26,10 @@ def valid?(action)
end
end
def
build
(
action
,
app
=
Proc
.
new
)
def
build
(
action
,
app
=
nil
,
&
block
)
action
=
action
.
to_s
middlewares
.
reverse
.
inject
(
app
)
do
|
a
,
middleware
|
middlewares
.
reverse
.
inject
(
app
||
block
)
do
|
a
,
middleware
|
middleware
.
valid?
(
action
)
?
middleware
.
build
(
a
)
:
a
end
end
...
...
actionpack/lib/action_dispatch/middleware/stack.rb
浏览文件 @
17c4240e
...
...
@@ -97,8 +97,8 @@ def use(klass, *args, &block)
middlewares
.
push
(
build_middleware
(
klass
,
args
,
block
))
end
def
build
(
app
=
Proc
.
new
)
middlewares
.
freeze
.
reverse
.
inject
(
app
)
{
|
a
,
e
|
e
.
build
(
a
)
}
def
build
(
app
=
nil
,
&
block
)
middlewares
.
freeze
.
reverse
.
inject
(
app
||
block
)
{
|
a
,
e
|
e
.
build
(
a
)
}
end
private
...
...
actionview/lib/action_view/helpers/form_helper.rb
浏览文件 @
17c4240e
...
...
@@ -736,7 +736,7 @@ def apply_form_for_options!(record, object, options) #:nodoc:
# def labelled_form_with(**options, &block)
# form_with(**options.merge(builder: LabellingFormBuilder), &block)
# end
def
form_with
(
model:
nil
,
scope:
nil
,
url:
nil
,
format:
nil
,
**
options
)
def
form_with
(
model:
nil
,
scope:
nil
,
url:
nil
,
format:
nil
,
**
options
,
&
block
)
options
[
:allow_method_names_outside_object
]
=
true
options
[
:skip_default_ids
]
=
!
form_with_generates_ids
...
...
@@ -749,7 +749,7 @@ def form_with(model: nil, scope: nil, url: nil, format: nil, **options)
if
block_given?
builder
=
instantiate_builder
(
scope
,
model
,
options
)
output
=
capture
(
builder
,
&
Proc
.
new
)
output
=
capture
(
builder
,
&
block
)
options
[
:multipart
]
||=
builder
.
multipart?
html_options
=
html_options_for_form_with
(
url
,
model
,
options
)
...
...
activerecord/lib/active_record/associations/builder/collection_association.rb
浏览文件 @
17c4240e
...
...
@@ -20,10 +20,10 @@ def self.define_callbacks(model, reflection)
}
end
def
self
.
define_extensions
(
model
,
name
)
def
self
.
define_extensions
(
model
,
name
,
&
block
)
if
block_given?
extension_module_name
=
"
#{
model
.
name
.
demodulize
}#{
name
.
to_s
.
camelize
}
AssociationExtension"
extension
=
Module
.
new
(
&
Proc
.
new
)
extension
=
Module
.
new
(
&
block
)
model
.
parent
.
const_set
(
extension_module_name
,
extension
)
end
end
...
...
activerecord/lib/active_record/scoping/default.rb
浏览文件 @
17c4240e
...
...
@@ -86,8 +86,8 @@ def before_remove_const #:nodoc:
# # Should return a scope, you can call 'super' here etc.
# end
# end
def
default_scope
(
scope
=
nil
)
# :doc:
scope
=
Proc
.
new
if
block_given?
def
default_scope
(
scope
=
nil
,
&
block
)
# :doc:
scope
=
block
if
block_given?
if
scope
.
is_a?
(
Relation
)
||
!
scope
.
respond_to?
(
:call
)
raise
ArgumentError
,
...
...
activerecord/lib/active_record/statement_cache.rb
浏览文件 @
17c4240e
...
...
@@ -87,8 +87,8 @@ def bind(values)
end
end
def
self
.
create
(
connection
,
block
=
Proc
.
new
)
relation
=
block
.
call
Params
.
new
def
self
.
create
(
connection
,
callable
=
nil
,
&
block
)
relation
=
(
callable
||
block
)
.
call
Params
.
new
query_builder
,
binds
=
connection
.
cacheable_query
(
self
,
relation
.
arel
)
bind_map
=
BindMap
.
new
(
binds
)
new
(
query_builder
,
bind_map
,
relation
.
klass
)
...
...
activesupport/lib/active_support/notifications/fanout.rb
浏览文件 @
17c4240e
...
...
@@ -18,8 +18,8 @@ def initialize
super
end
def
subscribe
(
pattern
=
nil
,
block
=
Proc
.
new
)
subscriber
=
Subscribers
.
new
pattern
,
block
def
subscribe
(
pattern
=
nil
,
callable
=
nil
,
&
block
)
subscriber
=
Subscribers
.
new
(
pattern
,
callable
||
block
)
synchronize
do
@subscribers
<<
subscriber
@listeners_for
.
clear
...
...
railties/lib/rails/engine.rb
浏览文件 @
17c4240e
...
...
@@ -531,9 +531,9 @@ def env_config
# Defines the routes for this engine. If a block is given to
# routes, it is appended to the engine.
def
routes
def
routes
(
&
block
)
@routes
||=
ActionDispatch
::
Routing
::
RouteSet
.
new_with_config
(
config
)
@routes
.
append
(
&
Proc
.
new
)
if
block_given?
@routes
.
append
(
&
block
)
if
block_given?
@routes
end
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录