aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/application/configuration.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2015-12-09 15:26:46 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2015-12-09 15:26:46 -0300
commitb11bca98bf5431ce9522c6b5707f51cd8d7f401c (patch)
treef665325e17cb88cdc8b8ae3ef8750806a02ed0c3 /railties/lib/rails/application/configuration.rb
parentb05801754f6423a1d90954ef3f6e2f5dc55c6320 (diff)
parentcdb7a8477ff19f8ed6f549cedc901bd5934a61e8 (diff)
downloadrails-b11bca98bf5431ce9522c6b5707f51cd8d7f401c.tar.gz
rails-b11bca98bf5431ce9522c6b5707f51cd8d7f401c.tar.bz2
rails-b11bca98bf5431ce9522c6b5707f51cd8d7f401c.zip
Merge pull request #20831 from jmbejar/rails-api-json-error-response
Rails API: Ability to return error responses in json format also in development
Diffstat (limited to 'railties/lib/rails/application/configuration.rb')
-rw-r--r--railties/lib/rails/application/configuration.rb69
1 files changed, 40 insertions, 29 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb
index 91ed835bd6..a5550df0de 100644
--- a/railties/lib/rails/application/configuration.rb
+++ b/railties/lib/rails/application/configuration.rb
@@ -24,35 +24,36 @@ module Rails
def initialize(*)
super
self.encoding = "utf-8"
- @allow_concurrency = nil
- @consider_all_requests_local = false
- @filter_parameters = []
- @filter_redirect = []
- @helpers_paths = []
- @public_file_server = ActiveSupport::OrderedOptions.new
- @public_file_server.enabled = true
- @public_file_server.index_name = "index"
- @force_ssl = false
- @ssl_options = {}
- @session_store = :cookie_store
- @session_options = {}
- @time_zone = "UTC"
- @beginning_of_week = :monday
- @log_level = nil
- @generators = app_generators
- @cache_store = [ :file_store, "#{root}/tmp/cache/" ]
- @railties_order = [:all]
- @relative_url_root = ENV["RAILS_RELATIVE_URL_ROOT"]
- @reload_classes_only_on_change = true
- @file_watcher = file_update_checker
- @exceptions_app = nil
- @autoflush_log = true
- @log_formatter = ActiveSupport::Logger::SimpleFormatter.new
- @eager_load = nil
- @secret_token = nil
- @secret_key_base = nil
- @api_only = false
- @x = Custom.new
+ @allow_concurrency = nil
+ @consider_all_requests_local = false
+ @filter_parameters = []
+ @filter_redirect = []
+ @helpers_paths = []
+ @public_file_server = ActiveSupport::OrderedOptions.new
+ @public_file_server.enabled = true
+ @public_file_server.index_name = "index"
+ @force_ssl = false
+ @ssl_options = {}
+ @session_store = :cookie_store
+ @session_options = {}
+ @time_zone = "UTC"
+ @beginning_of_week = :monday
+ @log_level = nil
+ @generators = app_generators
+ @cache_store = [ :file_store, "#{root}/tmp/cache/" ]
+ @railties_order = [:all]
+ @relative_url_root = ENV["RAILS_RELATIVE_URL_ROOT"]
+ @reload_classes_only_on_change = true
+ @file_watcher = file_update_checker
+ @exceptions_app = nil
+ @autoflush_log = true
+ @log_formatter = ActiveSupport::Logger::SimpleFormatter.new
+ @eager_load = nil
+ @secret_token = nil
+ @secret_key_base = nil
+ @api_only = false
+ @debug_exception_response_format = nil
+ @x = Custom.new
end
def static_cache_control=(value)
@@ -95,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