未验证 提交 e056b9bf 编写于 作者: X Xavier Noria 提交者: GitHub

Merge pull request #35503 from samjohn/cannot-grammar-correction

Replace “can not” with “cannot”.
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -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!
......
......@@ -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)
......
......@@ -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
......
......@@ -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.
先完成此消息的编辑!
想要评论请 注册