aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/application.rb8
-rw-r--r--railties/lib/rails/application/configuration.rb4
-rw-r--r--railties/lib/rails/configuration.rb8
-rw-r--r--railties/lib/rails/generators.rb2
-rw-r--r--railties/lib/rails/generators/actions.rb2
-rw-r--r--railties/test/app_loader_test.rb10
-rw-r--r--railties/test/commands/console_test.rb7
7 files changed, 13 insertions, 28 deletions
diff --git a/railties/lib/rails/application.rb b/railties/lib/rails/application.rb
index e346d5cc3a..bc5cd230fc 100644
--- a/railties/lib/rails/application.rb
+++ b/railties/lib/rails/application.rb
@@ -373,9 +373,7 @@ module Rails
@config ||= Application::Configuration.new(self.class.find_root(self.class.called_from))
end
- def config=(configuration) #:nodoc:
- @config = configuration
- end
+ attr_writer :config
# Returns secrets added to config/secrets.yml.
#
@@ -413,9 +411,7 @@ module Rails
end
end
- def secrets=(secrets) #:nodoc:
- @secrets = secrets
- end
+ attr_writer :secrets
# The secret_key_base is used as the input secret to the application's key generator, which in turn
# is used to create all MessageVerifiers/MessageEncryptors, including the ones that sign and encrypt cookies.
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index bba573499d..9c54cc1f37 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -146,9 +146,7 @@ module Rails
@debug_exception_response_format || :default
end
- def debug_exception_response_format=(value)
- @debug_exception_response_format = value
- end
+ attr_writer :debug_exception_response_format
def paths
@paths ||= begin
diff --git a/railties/lib/rails/configuration.rb b/railties/lib/rails/configuration.rb
index d3a54d9364..e8741a50ba 100644
--- a/railties/lib/rails/configuration.rb
+++ b/railties/lib/rails/configuration.rb
@@ -79,13 +79,7 @@ module Rails
end
protected
- def operations
- @operations
- end
-
- def delete_operations
- @delete_operations
- end
+ attr_reader :operations, :delete_operations
end
class Generators #:nodoc:
diff --git a/railties/lib/rails/generators.rb b/railties/lib/rails/generators.rb
index 2a41403557..ed672ae48e 100644
--- a/railties/lib/rails/generators.rb
+++ b/railties/lib/rails/generators.rb
@@ -126,7 +126,7 @@ module Rails
)
if ARGV.first == "mailer"
- options[:rails].merge!(template_engine: :erb)
+ options[:rails][:template_engine] = :erb
end
end
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb
index d85bbfb03e..ae395708cb 100644
--- a/railties/lib/rails/generators/actions.rb
+++ b/railties/lib/rails/generators/actions.rb
@@ -298,7 +298,7 @@ module Rails
sudo = options[:sudo] && !Gem.win_platform? ? "sudo " : ""
config = { verbose: false }
- config.merge!(capture: options[:capture]) if options[:capture]
+ config[:capture] = options[:capture] if options[:capture]
in_root { run("#{sudo}#{extify(executor)} #{command} RAILS_ENV=#{env}", config) }
end
diff --git a/railties/test/app_loader_test.rb b/railties/test/app_loader_test.rb
index 93ed68fabb..0deb1a76df 100644
--- a/railties/test/app_loader_test.rb
+++ b/railties/test/app_loader_test.rb
@@ -9,12 +9,12 @@ class AppLoaderTest < ActiveSupport::TestCase
@loader ||= Class.new do
extend Rails::AppLoader
- def self.exec_arguments
- @exec_arguments
- end
+ class << self
+ attr_accessor :exec_arguments
- def self.exec(*args)
- @exec_arguments = args
+ def exec(*args)
+ self.exec_arguments = args
+ end
end
end
end
diff --git a/railties/test/commands/console_test.rb b/railties/test/commands/console_test.rb
index b7cdb8229e..0b2fe204f8 100644
--- a/railties/test/commands/console_test.rb
+++ b/railties/test/commands/console_test.rb
@@ -151,7 +151,8 @@ class Rails::ConsoleTest < ActiveSupport::TestCase
def build_app(console)
mocked_console = Class.new do
- attr_reader :sandbox, :console
+ attr_accessor :sandbox
+ attr_reader :console
def initialize(console)
@console = console
@@ -161,10 +162,6 @@ class Rails::ConsoleTest < ActiveSupport::TestCase
self
end
- def sandbox=(arg)
- @sandbox = arg
- end
-
def load_console
end
end