diff options
author | Brian Lopez <seniorlopez@gmail.com> | 2010-08-09 12:43:49 -0700 |
---|---|---|
committer | Brian Lopez <seniorlopez@gmail.com> | 2010-08-09 12:43:49 -0700 |
commit | ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc (patch) | |
tree | 1b3f6a3e49be0ebacb251de0c0fc12bf64e2e596 /actionpack/lib/abstract_controller/base.rb | |
parent | d8b90114ddd2a432280d114b9fe4ef1fdb38d132 (diff) | |
parent | 7171161124a2852ee7b40c5c632ba8e092c97409 (diff) | |
download | rails-ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc.tar.gz rails-ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc.tar.bz2 rails-ee9c950f2fe0c7953f0a9ad6a53439da7a4e89bc.zip |
bringing over latest from master
Diffstat (limited to 'actionpack/lib/abstract_controller/base.rb')
-rw-r--r-- | actionpack/lib/abstract_controller/base.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/lib/abstract_controller/base.rb b/actionpack/lib/abstract_controller/base.rb index 8a8337858b..db0a6736e0 100644 --- a/actionpack/lib/abstract_controller/base.rb +++ b/actionpack/lib/abstract_controller/base.rb @@ -72,6 +72,13 @@ module AbstractController end end + # action_methods are cached and there is sometimes need to refresh + # them. clear_action_methods! allows you to do that, so next time + # you run action_methods, they will be recalculated + def clear_action_methods! + @action_methods = nil + end + # Returns the full controller name, underscored, without the ending Controller. # For instance, MyApp::MyPostsController would return "my_app/my_posts" for # controller_name. @@ -81,6 +88,11 @@ module AbstractController def controller_path @controller_path ||= name.sub(/Controller$/, '').underscore unless anonymous? end + + def method_added(name) + super + clear_action_methods! + end end abstract! |