Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
张重言
rails
提交
e056b9bf
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 搜索 >>
未验证
提交
e056b9bf
编写于
3月 07, 2019
作者:
X
Xavier Noria
提交者:
GitHub
3月 07, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #35503 from samjohn/cannot-grammar-correction
Replace “can not” with “cannot”.
上级
a88b6f25
755112c7
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
7 addition
and
7 deletion
+7
-7
activemodel/test/cases/attribute_test.rb
activemodel/test/cases/attribute_test.rb
+1
-1
activerecord/lib/active_record/errors.rb
activerecord/lib/active_record/errors.rb
+1
-1
activerecord/lib/active_record/relation/finder_methods.rb
activerecord/lib/active_record/relation/finder_methods.rb
+1
-1
activerecord/lib/active_record/relation/query_methods.rb
activerecord/lib/active_record/relation/query_methods.rb
+1
-1
activerecord/lib/active_record/validations/uniqueness.rb
activerecord/lib/active_record/validations/uniqueness.rb
+1
-1
activerecord/test/cases/validations/uniqueness_validation_test.rb
...cord/test/cases/validations/uniqueness_validation_test.rb
+1
-1
guides/source/active_record_migrations.md
guides/source/active_record_migrations.md
+1
-1
未找到文件。
activemodel/test/cases/attribute_test.rb
浏览文件 @
e056b9bf
...
...
@@ -204,7 +204,7 @@ def assert_valid_value(*)
assert_not_predicate
unchanged
,
:changed?
end
test
"an attribute can
not be mutated if it has not been read,
test
"an attribute cannot be mutated if it has not been read,
and skips expensive calculations"
do
type_which_raises_from_all_methods
=
Object
.
new
attribute
=
Attribute
.
from_database
(
:foo
,
"bar"
,
type_which_raises_from_all_methods
)
...
...
activerecord/lib/active_record/errors.rb
浏览文件 @
e056b9bf
...
...
@@ -68,7 +68,7 @@ def initialize(message = nil, model = nil, primary_key = nil, id = nil)
# Raised by {ActiveRecord::Base#save!}[rdoc-ref:Persistence#save!] and
# {ActiveRecord::Base.create!}[rdoc-ref:Persistence::ClassMethods#create!]
# methods when a record is invalid and can
not be saved.
# methods when a record is invalid and cannot be saved.
class
RecordNotSaved
<
ActiveRecordError
attr_reader
:record
...
...
activerecord/lib/active_record/relation/finder_methods.rb
浏览文件 @
e056b9bf
...
...
@@ -7,7 +7,7 @@ module FinderMethods
ONE_AS_ONE
=
"1 AS one"
# Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]).
# If one or more records can
not be found for the requested ids, then ActiveRecord::RecordNotFound will be raised.
# If one or more records cannot be found for the requested ids, then ActiveRecord::RecordNotFound will be raised.
# If the primary key is an integer, find by id coerces its arguments by using +to_i+.
#
# Person.find(1) # returns the object for ID = 1
...
...
activerecord/lib/active_record/relation/query_methods.rb
浏览文件 @
e056b9bf
...
...
@@ -1117,7 +1117,7 @@ def reverse_sql_order(order_query)
o
.
reverse
when
String
if
does_not_support_reverse?
(
o
)
raise
IrreversibleOrderError
,
"Order
#{
o
.
inspect
}
can
not be reversed automatically"
raise
IrreversibleOrderError
,
"Order
#{
o
.
inspect
}
cannot be reversed automatically"
end
o
.
split
(
","
).
map!
do
|
s
|
s
.
strip!
...
...
activerecord/lib/active_record/validations/uniqueness.rb
浏览文件 @
e056b9bf
...
...
@@ -25,7 +25,7 @@ def validate_each(record, attribute, value)
if
finder_class
.
primary_key
relation
=
relation
.
where
.
not
(
finder_class
.
primary_key
=>
record
.
id_in_database
)
else
raise
UnknownPrimaryKey
.
new
(
finder_class
,
"Can
not validate uniqueness for persisted record without primary key."
)
raise
UnknownPrimaryKey
.
new
(
finder_class
,
"Cannot validate uniqueness for persisted record without primary key."
)
end
end
relation
=
scope_relation
(
record
,
relation
)
...
...
activerecord/test/cases/validations/uniqueness_validation_test.rb
浏览文件 @
e056b9bf
...
...
@@ -555,7 +555,7 @@ def self.name; "Dashboard" end
abc
.
save!
end
assert_match
(
/\AUnknown primary key for table dashboards in model/
,
e
.
message
)
assert_match
(
/Can
not validate uniqueness for persisted record without primary key.\z/
,
e
.
message
)
assert_match
(
/Cannot validate uniqueness for persisted record without primary key.\z/
,
e
.
message
)
end
def
test_validate_uniqueness_ignores_itself_when_primary_key_changed
...
...
guides/source/active_record_migrations.md
浏览文件 @
e056b9bf
...
...
@@ -484,7 +484,7 @@ add_foreign_key :articles, :authors
This adds a new foreign key to the
`author_id`
column of the
`articles`
table. The key references the
`id`
column of the
`authors`
table. If the
column names can
not be derived from the table names, you can use the
column names cannot be derived from the table names, you can use the
`:column`
and
`:primary_key`
options.
Rails will generate a name for every foreign key starting with
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录