mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
replace if ! with unless
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
This commit is contained in:
committed by
Santiago Pastorino
parent
b44e2abd9f
commit
ea14396c45
@@ -212,7 +212,7 @@ module ActionMailer
|
||||
|
||||
# If this is a multipart e-mail add the mime_version if it is not
|
||||
# already set.
|
||||
@mime_version ||= "1.0" if !@parts.empty?
|
||||
@mime_version ||= "1.0" unless @parts.empty?
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -407,7 +407,7 @@ module ActionController
|
||||
# Returns nil if no token is found.
|
||||
def authenticate(controller, &login_procedure)
|
||||
token, options = token_and_options(controller.request)
|
||||
if !token.blank?
|
||||
unless token.blank?
|
||||
login_procedure.call(token, options)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -72,7 +72,7 @@ module ActiveRecord
|
||||
end
|
||||
|
||||
adapter_method = "#{spec[:adapter]}_connection"
|
||||
if !respond_to?(adapter_method)
|
||||
unless respond_to?(adapter_method)
|
||||
raise AdapterNotFound, "database configuration specifies nonexistent #{spec[:adapter]} adapter"
|
||||
end
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ module ActiveSupport #:nodoc:
|
||||
def const_missing(const_name, nesting = nil)
|
||||
klass_name = name.presence || "Object"
|
||||
|
||||
if !nesting
|
||||
unless nesting
|
||||
# We'll assume that the nesting of Foo::Bar is ["Foo::Bar", "Foo"]
|
||||
# even though it might not be, such as in the case of
|
||||
# class Foo::Bar; Baz; end
|
||||
|
||||
@@ -95,7 +95,7 @@ module ActiveSupport
|
||||
end
|
||||
end
|
||||
|
||||
if !defined?(@has_win32)
|
||||
unless defined?(@has_win32)
|
||||
begin
|
||||
require 'Win32API'
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ module Rails
|
||||
middleware.use ::Rack::Cache, rack_cache if rack_cache
|
||||
|
||||
middleware.use ::ActionDispatch::Static, config.static_asset_paths if config.serve_static_assets
|
||||
middleware.use ::Rack::Lock if !config.allow_concurrency
|
||||
middleware.use ::Rack::Lock unless config.allow_concurrency
|
||||
middleware.use ::Rack::Runtime
|
||||
middleware.use ::Rails::Rack::Logger
|
||||
middleware.use ::ActionDispatch::ShowExceptions, config.consider_all_requests_local if config.action_dispatch.show_exceptions
|
||||
|
||||
@@ -19,7 +19,7 @@ module Rails
|
||||
def tail!
|
||||
@file.seek @cursor
|
||||
|
||||
if !@file.eof?
|
||||
unless @file.eof?
|
||||
contents = @file.read
|
||||
@cursor = @file.tell
|
||||
$stdout.print contents
|
||||
|
||||
Reference in New Issue
Block a user