Skip to content

Commit

Permalink
Replace "overwrite" with "override" [ci-skip]
Browse files Browse the repository at this point in the history
"Overwrite" means "destructively replace", and is more suitable when,
for example, talking about writing data to a location.

"Override" means "supersede", and is more suitable when, for example,
talking about redifining methods in a subclass.
  • Loading branch information
jonathanhefner committed Feb 21, 2022
1 parent 5fdbd21 commit 0d3effc
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion actioncable/lib/action_cable/channel/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def subscribe_to_channel
end

# Called by the cable connection when it's cut, so the channel has a chance to cleanup with callbacks.
# This method is not intended to be called directly by the user. Instead, overwrite the #unsubscribed callback.
# This method is not intended to be called directly by the user. Instead, override the #unsubscribed callback.
def unsubscribe_from_channel # :nodoc:
run_callbacks :unsubscribe do
unsubscribed
Expand Down
4 changes: 2 additions & 2 deletions actionmailbox/lib/action_mailbox/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module ActionMailbox
# routing :all => :backstop
# end
#
# Application mailboxes need to overwrite the +#process+ method, which is invoked by the framework after
# Application mailboxes need to override the +#process+ method, which is invoked by the framework after
# callbacks have been run. The callbacks available are: +before_processing+, +after_processing+, and
# +around_processing+. The primary use case is ensure certain preconditions to processing are fulfilled
# using +before_processing+ callbacks.
Expand Down Expand Up @@ -89,7 +89,7 @@ def perform_processing # :nodoc:
end

def process
# Overwrite in subclasses
# Override in subclasses
end

def finished_processing? # :nodoc:
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/metal/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def helpers
end
end

# Overwrite modules_for_helpers to accept :all as argument, which loads
# Override modules_for_helpers to accept :all as argument, which loads
# all helpers in helpers_path.
#
# ==== Parameters
Expand Down
2 changes: 1 addition & 1 deletion actionpack/lib/action_controller/metal/rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def render(*args) # :nodoc:
super
end

# Overwrite render_to_string because body can now be set to a Rack body.
# Override render_to_string because body can now be set to a Rack body.
def render_to_string(*)
result = super
if result.respond_to?(:each)
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/helpers/rendering_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def render(options = {}, locals = {}, &block)
end
end

# Overwrites _layout_for in the context object so it supports the case a block is
# Overrides _layout_for in the context object so it supports the case a block is
# passed to a partial. Returns the contents that are yielded to a layout, given a
# name or a block.
#
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/record_identifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ def dom_id(record, prefix = nil)
# on the default implementation (which just joins all key attributes with '_') or on your own
# overwritten version of the method. By default, this implementation passes the key string through a
# method that replaces all characters that are invalid inside DOM ids, with valid ones. You need to
# make sure yourself that your dom ids are valid, in case you overwrite this method.
# make sure yourself that your dom ids are valid, in case you override this method.
def record_key_for_dom_id(record) # :doc:
key = convert_to_model(record).to_key
key ? key.join(JOIN) : key
Expand Down
2 changes: 1 addition & 1 deletion actionview/lib/action_view/rendering.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def initialize
super
end

# Overwrite process to set up I18n proxy.
# Override process to set up I18n proxy.
def process(*) # :nodoc:
old_config, I18n.config = I18n.config, I18nProxy.new(I18n.config, lookup_context)
super
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/translation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module ActiveModel
module Translation
include ActiveModel::Naming

# Returns the +i18n_scope+ for the class. Overwrite if you want custom lookup.
# Returns the +i18n_scope+ for the class. Override if you want custom lookup.
def i18n_scope
:activemodel
end
Expand Down
2 changes: 1 addition & 1 deletion activemodel/lib/active_model/validations/callbacks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def set_options_for_callback(options)
end

private
# Overwrite run_validations! to include callbacks.
# Override run_validations! to include callbacks.
def run_validations!
_run_validation_callbacks { super }
end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/attribute_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def instance_method_already_implemented?(method_name)
super
else
# If ThisClass < ... < SomeSuperClass < ... < Base and SomeSuperClass
# defines its own attribute method, then we don't want to overwrite that.
# defines its own attribute method, then we don't want to override that.
defined = method_defined_within?(method_name, superclass, Base) &&
! superclass.instance_method(method_name).owner.is_a?(GeneratedAttributeMethods)
defined || super
Expand Down
6 changes: 3 additions & 3 deletions activerecord/lib/active_record/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module ActiveRecord # :nodoc:
# anonymous = User.new(name: "")
# anonymous.name? # => false
#
# Query methods will also respect any overwrites of default accessors:
# Query methods will also respect any overrides of default accessors:
#
# class User
# # Has admin boolean column
Expand All @@ -151,8 +151,8 @@ module ActiveRecord # :nodoc:
# user.read_attribute(:admin) # => true, gets the column value
# user[:admin] # => true, also gets the column value
#
# user.admin # => false, due to the getter overwrite
# user.admin? # => false, due to the getter overwrite
# user.admin # => false, due to the getter override
# user.admin? # => false, due to the getter override
#
# == Accessing attributes before they have been typecasted
#
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ def inspect # :nodoc:
end
end

# Overwrite the default class equality method to provide support for decorated models.
# Override the default class equality method to provide support for decorated models.
def ===(object) # :nodoc:
object.is_a?(self)
end
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/translation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def lookup_ancestors # :nodoc:
classes
end

# Set the i18n scope to overwrite ActiveModel.
# Set the i18n scope to override ActiveModel.
def i18n_scope # :nodoc:
:activerecord
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def with_indifferent_access
# Called when object is nested under an object that receives
# #with_indifferent_access. This method will be called on the current object
# by the enclosing object and is aliased to #with_indifferent_access by
# default. Subclasses of Hash may overwrite this method to return +self+ if
# default. Subclasses of Hash may override this method to return +self+ if
# converting to an <tt>ActiveSupport::HashWithIndifferentAccess</tt> would not be
# desirable.
#
Expand Down
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/core_ext/object/json.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

# Hack to load json gem first so we can overwrite its to_json.
# Hack to load json gem first so we can override its to_json.
require "json"
require "bigdecimal"
require "ipaddr"
Expand Down

0 comments on commit 0d3effc

Please sign in to comment.