Created
April 16, 2010 19:56
-
-
Save spastorino/368890 to your computer and use it in GitHub Desktop.
ActionController options results used in different ways
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
end | |
class MyController < ApplicationController | |
end | |
ActionController::Base.perform_caching = true | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
MyController.perform_caching # => true | |
MyController.new.perform_caching # => true | |
# --- | |
ActionController::Base.perform_caching = false | |
ActionController::Base.perform_caching # => false | |
ActionController::Base.new.perform_caching # => false | |
ApplicationController.perform_caching # => false | |
ApplicationController.new.perform_caching # => false | |
MyController.perform_caching # => false | |
MyController.new.perform_caching # => false | |
# --- | |
instance = ActionController::Base.new | |
instance.perform_caching = false | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
instance.perform_caching # => false | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
MyController.perform_caching # => true | |
MyController.new.perform_caching # => true | |
# --- | |
ApplicationController.perform_caching = true | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
MyController.perform_caching # => true | |
MyController.new.perform_caching # => true | |
# --- | |
ApplicationController.perform_caching = false | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => false | |
ApplicationController.new.perform_caching # => false | |
MyController.perform_caching # => false | |
MyController.new.perform_caching # => false | |
# ---- | |
instance = ApplicationController.new | |
instance.perform_caching = false | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
instance.perform_caching # => false | |
MyController.perform_caching # => true | |
MyController.new.perform_caching # => true | |
# --- | |
MyController.perform_caching = true | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
MyController.perform_caching # => true | |
MyController.new.perform_caching # => true | |
# --- | |
MyController.perform_caching = false | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
MyController.perform_caching # => false | |
MyController.new.perform_caching # => false | |
# ---- | |
instance = MyController.new | |
instance.perform_caching = false | |
ActionController::Base.perform_caching # => true | |
ActionController::Base.new.perform_caching # => true | |
ApplicationController.perform_caching # => true | |
ApplicationController.new.perform_caching # => true | |
MyController.perform_caching # => true | |
MyController.new.perform_caching # => true | |
instance.perform_caching # => false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment