diff options
author | José Valim <jose.valim@gmail.com> | 2011-12-05 08:46:10 -0800 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2011-12-05 08:46:10 -0800 |
commit | 168c088735d47ecb4347541afcbf4a873f50319a (patch) | |
tree | fdea4439e2d7270f9b5ee60ef11999a8b71e5e4b /actionpack/lib/action_controller/metal/params_wrapper.rb | |
parent | d4964b338667fb14d7755cd90af88bb267238958 (diff) | |
parent | 1f0e21ce3037b03a125229810d584db77c0c6ed4 (diff) | |
download | rails-168c088735d47ecb4347541afcbf4a873f50319a.tar.gz rails-168c088735d47ecb4347541afcbf4a873f50319a.tar.bz2 rails-168c088735d47ecb4347541afcbf4a873f50319a.zip |
Merge pull request #3863 from lest/params-wrapper-inflections
use classify in ParamsWrapper to derive model name from controller name
Diffstat (limited to 'actionpack/lib/action_controller/metal/params_wrapper.rb')
-rw-r--r-- | actionpack/lib/action_controller/metal/params_wrapper.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/metal/params_wrapper.rb b/actionpack/lib/action_controller/metal/params_wrapper.rb index e0d8e1c992..9dcea86253 100644 --- a/actionpack/lib/action_controller/metal/params_wrapper.rb +++ b/actionpack/lib/action_controller/metal/params_wrapper.rb @@ -141,7 +141,7 @@ module ActionController # try to find Foo::Bar::User, Foo::User and finally User. def _default_wrap_model #:nodoc: return nil if self.anonymous? - model_name = self.name.sub(/Controller$/, '').singularize + model_name = self.name.sub(/Controller$/, '').classify begin if model_klass = model_name.safe_constantize |