Skip to content

Commit

Permalink
Replace "Return" with "Returns" in API documentations
Browse files Browse the repository at this point in the history
The guidelines are explicit about how we shoulld start sentences with
"Returns" rather than "Return". So these instances should follow that way.

See also the enhancements at rails#50595.
  • Loading branch information
sato11 committed Jan 6, 2024
1 parent 3ce8890 commit 3b7ae37
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ def num_waiting_in_queue # :nodoc:
@available.num_waiting
end

# Return connection pool's usage statistic
# Returns the connection pool's usage statistic
# Example:
#
# ActiveRecord::Base.connection_pool.stat # => { size: 15, connections: 1, busy: 1, dead: 0, idle: 0, waiting: 0, checkout_timeout: 5 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -623,14 +623,14 @@ def advisory_locks_enabled? # :nodoc:
# This is meant to be implemented by the adapters that support advisory
# locks
#
# Return true if we got the lock, otherwise false
# Returns true if we got the lock, otherwise false
def get_advisory_lock(lock_id) # :nodoc:
end

# This is meant to be implemented by the adapters that support advisory
# locks.
#
# Return true if we released the lock, otherwise false
# Returns true if we released the lock, otherwise false
def release_advisory_lock(lock_id) # :nodoc:
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def quote_default_expression(value, column) # :nodoc:
def type_cast(value) # :nodoc:
case value
when Type::Binary::Data
# Return a bind param hash with format as binary.
# Returns a bind param hash with format as binary.
# See https://deveiate.org/code/pg/PG/Connection.html#method-i-exec_prepared-doc
# for more information
{ value: value.to_s, format: 1 }
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/connection_handling.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def connection

attr_writer :connection_specification_name

# Return the connection specification name from the current class or its parent.
# Returns the connection specification name from the current class or its parent.
def connection_specification_name
if @connection_specification_name.nil?
return self == Base ? Base.name : superclass.connection_specification_name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def initialize(env_name, name, url, configuration_hash = {})
end

private
# Return a Hash that can be merged into the main config that represents
# Returns a Hash that can be merged into the main config that represents
# the passed in url
def build_url_hash
if url.nil? || url.start_with?("jdbc:", "http:", "https:")
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1512,7 +1512,7 @@ def ran?(migration)
migrated.include?(migration.version.to_i)
end

# Return true if a valid version is not provided.
# Returns true if a valid version is not provided.
def invalid_target?
@target_version && @target_version != 0 && !target
end
Expand Down

0 comments on commit 3b7ae37

Please sign in to comment.