Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
a077f94f
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 搜索 >>
未验证
提交
a077f94f
编写于
11月 04, 2019
作者:
R
Rafael França
提交者:
Rafael Mendonça França
11月 04, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Merge pull request #37504 from utilum/no_implicit_conversion_of_nil
TypeError Regexp#match?(nil) in Ruby Head
上级
bd8a709a
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
20 addition
and
12 deletion
+20
-12
actionpack/lib/action_controller/metal/request_forgery_protection.rb
...lib/action_controller/metal/request_forgery_protection.rb
+1
-1
actionpack/lib/action_dispatch/http/mime_type.rb
actionpack/lib/action_dispatch/http/mime_type.rb
+1
-1
actionpack/lib/action_dispatch/http/request.rb
actionpack/lib/action_dispatch/http/request.rb
+2
-1
actionpack/lib/action_dispatch/journey/formatter.rb
actionpack/lib/action_dispatch/journey/formatter.rb
+1
-1
actionpack/lib/action_dispatch/routing/mapper.rb
actionpack/lib/action_dispatch/routing/mapper.rb
+2
-2
actionview/lib/action_view/layouts.rb
actionview/lib/action_view/layouts.rb
+5
-1
activemodel/test/validators/email_validator.rb
activemodel/test/validators/email_validator.rb
+3
-2
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
...lib/active_record/connection_adapters/abstract_adapter.rb
+3
-1
activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb
...ive_record/connection_adapters/mysql/schema_statements.rb
+1
-1
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
...b/active_record/connection_adapters/postgresql_adapter.rb
+1
-1
未找到文件。
actionpack/lib/action_controller/metal/request_forgery_protection.rb
浏览文件 @
a077f94f
...
...
@@ -282,7 +282,7 @@ def marked_for_same_origin_verification? # :doc:
# Check for cross-origin JavaScript responses.
def
non_xhr_javascript_response?
# :doc:
%r(
\A
(?:text|application)/javascript)
.
match?
(
media_type
)
&&
!
request
.
xhr?
media_type
&&
%r(
\A
(?:text|application)/javascript)
.
match?
(
media_type
)
&&
!
request
.
xhr?
end
AUTHENTICITY_TOKEN_LENGTH
=
32
...
...
actionpack/lib/action_dispatch/http/mime_type.rb
浏览文件 @
a077f94f
...
...
@@ -231,7 +231,7 @@ def unregister(symbol)
class
InvalidMimeType
<
StandardError
;
end
def
initialize
(
string
,
symbol
=
nil
,
synonyms
=
[])
unless
MIME_REGEXP
.
match?
(
string
)
if
string
.
nil?
||
!
MIME_REGEXP
.
match?
(
string
)
raise
InvalidMimeType
,
"
#{
string
.
inspect
}
is not a valid MIME type"
end
@symbol
,
@synonyms
=
symbol
,
synonyms
...
...
actionpack/lib/action_dispatch/http/request.rb
浏览文件 @
a077f94f
...
...
@@ -264,7 +264,8 @@ def content_length
# (case-insensitive), which may need to be manually added depending on the
# choice of JavaScript libraries and frameworks.
def
xml_http_request?
get_header
(
"HTTP_X_REQUESTED_WITH"
)
=~
/XMLHttpRequest/i
header
=
get_header
(
"HTTP_X_REQUESTED_WITH"
)
header
&&
/XMLHttpRequest/i
.
match?
(
header
)
end
alias
:xhr?
:xml_http_request?
...
...
actionpack/lib/action_dispatch/journey/formatter.rb
浏览文件 @
a077f94f
...
...
@@ -152,7 +152,7 @@ def missing_keys(route, parts)
missing_keys
<<
key
end
else
unless
/\A
#{
tests
[
key
]
}
\Z/
===
parts
[
key
]
if
parts
[
key
].
nil?
||
!
/\A
#{
tests
[
key
]
}
\Z/
.
match?
(
parts
[
key
])
missing_keys
||=
[]
missing_keys
<<
key
end
...
...
actionpack/lib/action_dispatch/routing/mapper.rb
浏览文件 @
a077f94f
...
...
@@ -341,7 +341,7 @@ def check_part(name, part, path_params, hash)
end
def
split_to
(
to
)
if
/#/
.
match?
(
to
)
if
to
&&
/#/
.
match?
(
to
)
to
.
split
(
"#"
)
else
[]
...
...
@@ -350,7 +350,7 @@ def split_to(to)
def
add_controller_module
(
controller
,
modyoule
)
if
modyoule
&&
!
controller
.
is_a?
(
Regexp
)
if
%r{
\A
/}
.
match?
(
controller
)
if
controller
&&
controller
.
start_with?
(
"/"
)
controller
[
1
..-
1
]
else
[
modyoule
,
controller
].
compact
.
join
(
"/"
)
...
...
actionview/lib/action_view/layouts.rb
浏览文件 @
a077f94f
...
...
@@ -281,7 +281,11 @@ def layout(layout, conditions = {})
def
_write_layout_method
# :nodoc:
silence_redefinition_of_method
(
:_layout
)
prefixes
=
/\blayouts/
.
match?
(
_implied_layout_name
)
?
[]
:
[
"layouts"
]
prefixes
=
if
_implied_layout_name
&&
/\blayouts/
.
match?
(
_implied_layout_name
)
[]
else
[
"layouts"
]
end
default_behavior
=
"lookup_context.find_all('
#{
_implied_layout_name
}
',
#{
prefixes
.
inspect
}
, false, [], { formats: formats }).first || super"
name_clause
=
if
name
default_behavior
...
...
activemodel/test/validators/email_validator.rb
浏览文件 @
a077f94f
...
...
@@ -2,7 +2,8 @@
class
EmailValidator
<
ActiveModel
::
EachValidator
def
validate_each
(
record
,
attribute
,
value
)
record
.
errors
[
attribute
]
<<
(
options
[
:message
]
||
"is not an email"
)
unless
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
.
match?
(
value
)
if
value
.
nil?
||
!
/\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
.
match?
(
value
)
record
.
errors
[
attribute
]
<<
(
options
[
:message
]
||
"is not an email"
)
end
end
end
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
浏览文件 @
a077f94f
...
...
@@ -85,7 +85,9 @@ class AbstractAdapter
set_callback
:checkin
,
:after
,
:enable_lazy_transactions!
def
self
.
type_cast_config_to_integer
(
config
)
if
config
.
is_a?
(
Integer
)
if
config
.
nil?
config
elsif
config
.
is_a?
(
Integer
)
config
elsif
SIMPLE_INT
.
match?
(
config
)
config
.
to_i
...
...
activerecord/lib/active_record/connection_adapters/mysql/schema_statements.rb
浏览文件 @
a077f94f
...
...
@@ -162,7 +162,7 @@ def new_column_from_field(table_name, field)
type_metadata
=
fetch_type_metadata
(
field
[
:Type
],
field
[
:Extra
])
default
,
default_function
=
field
[
:Default
],
nil
if
type_metadata
.
type
==
:datetime
&&
/\ACURRENT_TIMESTAMP(?:\([0-6]?\))?\z/i
.
match?
(
default
)
if
type_metadata
.
type
==
:datetime
&&
default
&&
/\ACURRENT_TIMESTAMP(?:\([0-6]?\))?\z/i
.
match?
(
default
)
default
,
default_function
=
nil
,
default
elsif
type_metadata
.
extra
==
"DEFAULT_GENERATED"
default
=
+
"(
#{
default
}
)"
unless
default
.
start_with?
(
"("
)
...
...
activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
浏览文件 @
a077f94f
...
...
@@ -617,7 +617,7 @@ def extract_default_function(default_value, default)
end
def
has_default_function?
(
default_value
,
default
)
!
default_value
&&
%r{
\w
+
\(
.*
\)
|
\(
.*
\)
::
\w
+|CURRENT_DATE|CURRENT_TIMESTAMP}
.
match?
(
default
)
!
default_value
&&
default
&&
%r{
\w
+
\(
.*
\)
|
\(
.*
\)
::
\w
+|CURRENT_DATE|CURRENT_TIMESTAMP}
.
match?
(
default
)
end
def
load_additional_types
(
oids
=
nil
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录