Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
8764ef95
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,发现更多精彩内容 >>
提交
8764ef95
编写于
10月 02, 2014
作者:
A
Alexander Balashov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change `gsub` to `tr` where possible
上级
7b740f31
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
4 addition
and
4 deletion
+4
-4
actionview/test/template/test_case_test.rb
actionview/test/template/test_case_test.rb
+1
-1
activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
...ve_record/associations/builder/has_and_belongs_to_many.rb
+1
-1
activerecord/lib/active_record/model_schema.rb
activerecord/lib/active_record/model_schema.rb
+1
-1
activesupport/lib/active_support/values/time_zone.rb
activesupport/lib/active_support/values/time_zone.rb
+1
-1
未找到文件。
actionview/test/template/test_case_test.rb
浏览文件 @
8764ef95
...
...
@@ -155,7 +155,7 @@ class ViewAssignsTest < ActionView::TestCase
test
"view_assigns excludes internal ivars"
do
INTERNAL_IVARS
.
each
do
|
ivar
|
assert
defined?
(
ivar
),
"expected
#{
ivar
}
to be defined"
assert
!
view_assigns
.
keys
.
include?
(
ivar
.
to_s
.
sub
(
'@'
,
''
).
to_sym
),
"expected
#{
ivar
}
to be excluded from view_assigns"
assert
!
view_assigns
.
keys
.
include?
(
ivar
.
to_s
.
tr
(
'@'
,
''
).
to_sym
),
"expected
#{
ivar
}
to be excluded from view_assigns"
end
end
end
...
...
activerecord/lib/active_record/associations/builder/has_and_belongs_to_many.rb
浏览文件 @
8764ef95
...
...
@@ -11,7 +11,7 @@ def initialize(lhs_class, rhs_class_name)
end
def
join_table
@join_table
||=
[
@lhs_class
.
table_name
,
klass
.
table_name
].
sort
.
join
(
"
\0
"
).
gsub
(
/^(.*[._])(.+)\0\1(.+)/
,
'\1\2_\3'
).
gsub
(
"
\0
"
,
"_"
)
@join_table
||=
[
@lhs_class
.
table_name
,
klass
.
table_name
].
sort
.
join
(
"
\0
"
).
gsub
(
/^(.*[._])(.+)\0\1(.+)/
,
'\1\2_\3'
).
tr
(
"
\0
"
,
"_"
)
end
private
...
...
activerecord/lib/active_record/model_schema.rb
浏览文件 @
8764ef95
...
...
@@ -63,7 +63,7 @@ module ModelSchema
# records, artists => artists_records
# music_artists, music_records => music_artists_records
def
self
.
derive_join_table_name
(
first_table
,
second_table
)
# :nodoc:
[
first_table
.
to_s
,
second_table
.
to_s
].
sort
.
join
(
"
\0
"
).
gsub
(
/^(.*_)(.+)\0\1(.+)/
,
'\1\2_\3'
).
gsub
(
"
\0
"
,
"_"
)
[
first_table
.
to_s
,
second_table
.
to_s
].
sort
.
join
(
"
\0
"
).
gsub
(
/^(.*_)(.+)\0\1(.+)/
,
'\1\2_\3'
).
tr
(
"
\0
"
,
"_"
)
end
module
ClassMethods
...
...
activesupport/lib/active_support/values/time_zone.rb
浏览文件 @
8764ef95
...
...
@@ -184,7 +184,7 @@ class TimeZone
}
UTC_OFFSET_WITH_COLON
=
'%s%02d:%02d'
UTC_OFFSET_WITHOUT_COLON
=
UTC_OFFSET_WITH_COLON
.
sub
(
':'
,
''
)
UTC_OFFSET_WITHOUT_COLON
=
UTC_OFFSET_WITH_COLON
.
tr
(
':'
,
''
)
@lazy_zones_map
=
ThreadSafe
::
Cache
.
new
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录