aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-01-24 00:26:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-01-24 00:26:44 +0000
commitf31291ab5a5d928f7f73f32fa9f2261c1f446476 (patch)
treeda6f7231351274c29c7de2aec2dfb8fd5b9b48a7 /actionpack/lib/action_controller
parent0942bfa7a96e981bf146dee1ad32fa81e68ee6e6 (diff)
downloadrails-f31291ab5a5d928f7f73f32fa9f2261c1f446476.tar.gz
rails-f31291ab5a5d928f7f73f32fa9f2261c1f446476.tar.bz2
rails-f31291ab5a5d928f7f73f32fa9f2261c1f446476.zip
Another swing at reloading
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@479 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/dependencies.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/actionpack/lib/action_controller/dependencies.rb b/actionpack/lib/action_controller/dependencies.rb
index e1ede3d42a..6b43a3a57f 100644
--- a/actionpack/lib/action_controller/dependencies.rb
+++ b/actionpack/lib/action_controller/dependencies.rb
@@ -78,8 +78,9 @@ module ActionController #:nodoc:
inherited_without_model(child)
return if child.controller_name == "application" # otherwise the ApplicationController in Rails will include itself
begin
- child.model(Inflector.singularize(child.controller_name))
- rescue LoadError
+ Object.const_get(child.controller_name.singularize.classify)
+ child.model(child.controller_name.singularize)
+ rescue NameError, LoadError
# No neither singular or plural model available for this controller
end
end