Skip to content

Commit

Permalink
Merge pull request #35503 from samjohn/cannot-grammar-correction
Browse files Browse the repository at this point in the history
Replace “can not” with “cannot”.
  • Loading branch information
fxn committed Mar 7, 2019
2 parents a88b6f2 + 755112c commit e056b9b
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion activemodel/test/cases/attribute_test.rb
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/errors.rb
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/finder_methods.rb
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -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!
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/validations/uniqueness.rb
Expand Up @@ -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)
Expand Down
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion guides/source/active_record_migrations.md
Expand Up @@ -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
Expand Down

0 comments on commit e056b9b

Please sign in to comment.