diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2016-07-05 15:05:04 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-05 15:05:04 -0300 |
commit | 55c7de37a618ac68936365657160260150db907d (patch) | |
tree | 60290b4a59ccc2e75ebc061315736ee5f6d976b2 /railties | |
parent | 2797de25141098c501dd32d72af8050997cfe036 (diff) | |
parent | 5086432097495e53a5a08be4eb4b1420effd1278 (diff) | |
download | rails-55c7de37a618ac68936365657160260150db907d.tar.gz rails-55c7de37a618ac68936365657160260150db907d.tar.bz2 rails-55c7de37a618ac68936365657160260150db907d.zip |
Merge pull request #25704 from fledman/add_respond_to_missing_to_rails_application_configuration_custom
implement respond_to_missing? to match method_missing
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 4 | ||||
-rw-r--r-- | railties/test/application/configuration/custom_test.rb | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 5ee08d96e1..8e3f01edd7 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -206,6 +206,10 @@ module Rails } end end + + def respond_to_missing?(symbol, *) + true + end end end end diff --git a/railties/test/application/configuration/custom_test.rb b/railties/test/application/configuration/custom_test.rb index 28b3b2f2d6..3e0db6fad8 100644 --- a/railties/test/application/configuration/custom_test.rb +++ b/railties/test/application/configuration/custom_test.rb @@ -33,6 +33,13 @@ module ApplicationTests assert_nil x.i_do_not_exist.zomg end + test 'custom configuration responds to all messages' do + x = Rails.configuration.x + assert_equal true, x.respond_to?(:i_do_not_exist) + assert_kind_of Method, x.method(:i_do_not_exist) + assert_kind_of ActiveSupport::OrderedOptions, x.i_do_not_exist + end + private def new_app File.expand_path("#{app_path}/../new_app") |