aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/configuration.rb
diff options
context:
space:
mode:
authorJorge Bejar <jorge@wyeworks.com>2015-12-04 18:05:45 -0300
committerJorge Bejar <jorge@wyeworks.com>2015-12-09 10:53:46 -0300
commita0343d11f1bf80a79e273c1d0cf9934ef2601e98 (patch)
treeb93dee360852a4b645485e00f5ea39c862cc1a3e /railties/lib/rails/application/configuration.rb
parent2430268f187332c2054c781be1d165dc8c269318 (diff)
downloadrails-a0343d11f1bf80a79e273c1d0cf9934ef2601e98.tar.gz
rails-a0343d11f1bf80a79e273c1d0cf9934ef2601e98.tar.bz2
rails-a0343d11f1bf80a79e273c1d0cf9934ef2601e98.zip
Make debug_exception_response_format config depends on api_only when is not set
Diffstat (limited to 'railties/lib/rails/application/configuration.rb')
-rw-r--r--railties/lib/rails/application/configuration.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 071677848e..a5550df0de 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -16,7 +16,7 @@ module Rails
:railties_order, :relative_url_root, :secret_key_base, :secret_token,
:ssl_options, :public_file_server,
:session_options, :time_zone, :reload_classes_only_on_change,
- :beginning_of_week, :filter_redirect, :debug_exception_response_format, :x
+ :beginning_of_week, :filter_redirect, :x
attr_writer :log_level
attr_reader :encoding, :api_only, :static_cache_control
@@ -52,7 +52,7 @@ module Rails
@secret_token = nil
@secret_key_base = nil
@api_only = false
- @debug_exception_response_format = :default
+ @debug_exception_response_format = nil
@x = Custom.new
end
@@ -96,6 +96,16 @@ module Rails
def api_only=(value)
@api_only = value
generators.api_only = value
+
+ @debug_exception_response_format ||= :api
+ end
+
+ def debug_exception_response_format
+ @debug_exception_response_format || :default
+ end
+
+ def debug_exception_response_format=(value)
+ @debug_exception_response_format = value
end
def paths