Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
ce4a1bb8
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 搜索 >>
提交
ce4a1bb8
编写于
6月 26, 2008
作者:
C
Cheah Chu Yeow
提交者:
Jeremy Kemper
7月 09, 2008
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove some Symbol#to_proc usage in runtime code. [#484 state:resolved]
上级
11252e35
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
27 addition
and
19 deletion
+27
-19
actionpack/lib/action_controller/base.rb
actionpack/lib/action_controller/base.rb
+6
-6
actionpack/lib/action_controller/filters.rb
actionpack/lib/action_controller/filters.rb
+12
-4
activerecord/lib/active_record/associations.rb
activerecord/lib/active_record/associations.rb
+2
-2
activerecord/lib/active_record/associations/association_collection.rb
.../lib/active_record/associations/association_collection.rb
+1
-1
activerecord/lib/active_record/associations/has_many_association.rb
...rd/lib/active_record/associations/has_many_association.rb
+2
-2
activesupport/lib/active_support/core_ext/module/introspection.rb
...pport/lib/active_support/core_ext/module/introspection.rb
+1
-1
activesupport/lib/active_support/core_ext/object/instance_variables.rb
.../lib/active_support/core_ext/object/instance_variables.rb
+1
-1
activesupport/lib/active_support/dependencies.rb
activesupport/lib/active_support/dependencies.rb
+2
-2
未找到文件。
actionpack/lib/action_controller/base.rb
浏览文件 @
ce4a1bb8
...
...
@@ -412,7 +412,7 @@ def controller_path
# More methods can be hidden using <tt>hide_actions</tt>.
def
hidden_actions
unless
read_inheritable_attribute
(
:hidden_actions
)
write_inheritable_attribute
(
:hidden_actions
,
ActionController
::
Base
.
public_instance_methods
.
map
(
&
:to_s
)
)
write_inheritable_attribute
(
:hidden_actions
,
ActionController
::
Base
.
public_instance_methods
.
map
{
|
m
|
m
.
to_s
}
)
end
read_inheritable_attribute
(
:hidden_actions
)
...
...
@@ -420,12 +420,12 @@ def hidden_actions
# Hide each of the given methods from being callable as actions.
def
hide_action
(
*
names
)
write_inheritable_attribute
(
:hidden_actions
,
hidden_actions
|
names
.
map
(
&
:to_s
)
)
write_inheritable_attribute
(
:hidden_actions
,
hidden_actions
|
names
.
map
{
|
name
|
name
.
to_s
}
)
end
#
#
View load paths determine the bases from which template references can be made. So a call to
#
#
render("test/template") will be looked up in the view load paths array and the closest match will be
#
#
returned.
# View load paths determine the bases from which template references can be made. So a call to
# render("test/template") will be looked up in the view load paths array and the closest match will be
# returned.
def
view_paths
@view_paths
||
superclass
.
view_paths
end
...
...
@@ -1201,7 +1201,7 @@ def action_methods
end
def
self
.
action_methods
@action_methods
||=
Set
.
new
(
public_instance_methods
.
map
(
&
:to_s
)
)
-
hidden_actions
@action_methods
||=
Set
.
new
(
public_instance_methods
.
map
{
|
m
|
m
.
to_s
}
)
-
hidden_actions
end
def
add_variables_to_assigns
...
...
actionpack/lib/action_controller/filters.rb
浏览文件 @
ce4a1bb8
...
...
@@ -127,9 +127,9 @@ def should_not_skip?(controller)
def
included_in_action?
(
controller
,
options
)
if
options
[
:only
]
Array
(
options
[
:only
]).
map
(
&
:to_s
)
.
include?
(
controller
.
action_name
)
Array
(
options
[
:only
]).
map
{
|
o
|
o
.
to_s
}
.
include?
(
controller
.
action_name
)
elsif
options
[
:except
]
!
Array
(
options
[
:except
]).
map
(
&
:to_s
)
.
include?
(
controller
.
action_name
)
!
Array
(
options
[
:except
]).
map
{
|
o
|
o
.
to_s
}
.
include?
(
controller
.
action_name
)
else
true
end
...
...
@@ -544,13 +544,21 @@ def filter_chain
# Returns all the before filters for this class and all its ancestors.
# This method returns the actual filter that was assigned in the controller to maintain existing functionality.
def
before_filters
#:nodoc:
filter_chain
.
select
(
&
:before?
).
map
(
&
:method
)
filters
=
[]
filter_chain
.
each
do
|
filter
|
filters
<<
filter
.
method
if
filter
.
before?
end
filters
end
# Returns all the after filters for this class and all its ancestors.
# This method returns the actual filter that was assigned in the controller to maintain existing functionality.
def
after_filters
#:nodoc:
filter_chain
.
select
(
&
:after?
).
map
(
&
:method
)
filters
=
[]
filter_chain
.
each
do
|
filter
|
filters
<<
filter
.
method
if
filter
.
after?
end
filters
end
end
...
...
activerecord/lib/active_record/associations.rb
浏览文件 @
ce4a1bb8
...
...
@@ -1145,7 +1145,7 @@ def collection_reader_method(reflection, association_proxy_class)
end
define_method
(
"
#{
reflection
.
name
.
to_s
.
singularize
}
_ids"
)
do
send
(
reflection
.
name
).
map
(
&
:id
)
send
(
reflection
.
name
).
map
{
|
record
|
record
.
id
}
end
end
...
...
@@ -1490,7 +1490,7 @@ def construct_finder_sql_for_association_limiting(options, join_dependency)
sql
<<
" FROM
#{
connection
.
quote_table_name
table_name
}
"
if
is_distinct
sql
<<
distinct_join_associations
.
collect
(
&
:association_join
)
.
join
sql
<<
distinct_join_associations
.
collect
{
|
assoc
|
assoc
.
association_join
}
.
join
add_joins!
(
sql
,
options
,
scope
)
end
...
...
activerecord/lib/active_record/associations/association_collection.rb
浏览文件 @
ce4a1bb8
...
...
@@ -14,7 +14,7 @@ def find(*args)
# If using a custom finder_sql, scan the entire collection.
if
@reflection
.
options
[
:finder_sql
]
expects_array
=
args
.
first
.
kind_of?
(
Array
)
ids
=
args
.
flatten
.
compact
.
uniq
.
map
(
&
:to_i
)
ids
=
args
.
flatten
.
compact
.
uniq
.
map
{
|
arg
|
arg
.
to_i
}
if
ids
.
size
==
1
id
=
ids
.
first
...
...
activerecord/lib/active_record/associations/has_many_association.rb
浏览文件 @
ce4a1bb8
...
...
@@ -61,9 +61,9 @@ def insert_record(record)
def
delete_records
(
records
)
case
@reflection
.
options
[
:dependent
]
when
:destroy
records
.
each
(
&
:destroy
)
records
.
each
{
|
r
|
r
.
destroy
}
when
:delete_all
@reflection
.
klass
.
delete
(
records
.
map
(
&
:id
)
)
@reflection
.
klass
.
delete
(
records
.
map
{
|
record
|
record
.
id
}
)
else
ids
=
quoted_record_ids
(
records
)
@reflection
.
klass
.
update_all
(
...
...
activesupport/lib/active_support/core_ext/module/introspection.rb
浏览文件 @
ce4a1bb8
...
...
@@ -70,6 +70,6 @@ def local_constants #:nodoc:
# Returns the names of the constants defined locally rather than the
# constants themselves. See <tt>local_constants</tt>.
def
local_constant_names
local_constants
.
map
(
&
:to_s
)
local_constants
.
map
{
|
c
|
c
.
to_s
}
end
end
activesupport/lib/active_support/core_ext/object/instance_variables.rb
浏览文件 @
ce4a1bb8
...
...
@@ -35,7 +35,7 @@ def instance_values #:nodoc:
# C.new(0, 1).instance_variable_names # => ["@y", "@x"]
if
RUBY_VERSION
>=
'1.9'
def
instance_variable_names
instance_variables
.
map
(
&
:to_s
)
instance_variables
.
map
{
|
var
|
var
.
to_s
}
end
else
alias_method
:instance_variable_names
,
:instance_variables
...
...
activesupport/lib/active_support/dependencies.rb
浏览文件 @
ce4a1bb8
...
...
@@ -387,7 +387,7 @@ def new_constants_in(*descs)
ensure
# Remove the stack frames that we added.
if
defined?
(
watch_frames
)
&&
!
watch_frames
.
blank?
frame_ids
=
watch_frames
.
collect
(
&
:object_id
)
frame_ids
=
watch_frames
.
collect
{
|
frame
|
frame
.
object_id
}
constant_watch_stack
.
delete_if
do
|
watch_frame
|
frame_ids
.
include?
watch_frame
.
object_id
end
...
...
@@ -437,7 +437,7 @@ def remove_constant(const) #:nodoc:
protected
def
log_call
(
*
args
)
if
defined?
(
RAILS_DEFAULT_LOGGER
)
&&
RAILS_DEFAULT_LOGGER
&&
log_activity
arg_str
=
args
.
collect
(
&
:inspect
)
*
', '
arg_str
=
args
.
collect
{
|
arg
|
arg
.
inspect
}
*
', '
/in `([a-z_\?\!]+)'/
=~
caller
(
1
).
first
selector
=
$1
||
'<unknown>'
log
"called
#{
selector
}
(
#{
arg_str
}
)"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录