diff options
author | Clemens Kofler <clemens@railway.at> | 2008-09-02 15:33:49 +0200 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-09-03 00:55:23 +0200 |
commit | 288e947ae1737645985fde76f5382baaff700505 (patch) | |
tree | 3b48855cc336f3f1d04f2a14aa68b63ffc52ddba /actionpack | |
parent | 4d092ba2089de185cc8f5a8d16432b348e102046 (diff) | |
download | rails-288e947ae1737645985fde76f5382baaff700505.tar.gz rails-288e947ae1737645985fde76f5382baaff700505.tar.bz2 rails-288e947ae1737645985fde76f5382baaff700505.zip |
Some performance goodness for inheritable attributes.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller/layout.rb | 12 | ||||
-rw-r--r-- | actionpack/lib/action_controller/session_management.rb | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 8432a008eb..3631ce86af 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -164,17 +164,17 @@ module ActionController #:nodoc: # performance and have access to them as any normal template would. def layout(template_name, conditions = {}, auto = false) add_layout_conditions(conditions) - write_inheritable_attribute "layout", template_name - write_inheritable_attribute "auto_layout", auto + write_inheritable_attribute(:layout, template_name) + write_inheritable_attribute(:auto_layout, auto) end def layout_conditions #:nodoc: - @layout_conditions ||= read_inheritable_attribute("layout_conditions") + @layout_conditions ||= read_inheritable_attribute(:layout_conditions) end def default_layout(format) #:nodoc: - layout = read_inheritable_attribute("layout") - return layout unless read_inheritable_attribute("auto_layout") + layout = read_inheritable_attribute(:layout) + return layout unless read_inheritable_attribute(:auto_layout) @default_layout ||= {} @default_layout[format] ||= default_layout_with_format(format, layout) @default_layout[format] @@ -194,7 +194,7 @@ module ActionController #:nodoc: end def add_layout_conditions(conditions) - write_inheritable_hash "layout_conditions", normalize_conditions(conditions) + write_inheritable_hash(:layout_conditions, normalize_conditions(conditions)) end def normalize_conditions(conditions) diff --git a/actionpack/lib/action_controller/session_management.rb b/actionpack/lib/action_controller/session_management.rb index 80a3ddd2c5..f5a1155a46 100644 --- a/actionpack/lib/action_controller/session_management.rb +++ b/actionpack/lib/action_controller/session_management.rb @@ -86,14 +86,14 @@ module ActionController #:nodoc: raise ArgumentError, "only one of either :only or :except are allowed" end - write_inheritable_array("session_options", [options]) + write_inheritable_array(:session_options, [options]) end # So we can declare session options in the Rails initializer. alias_method :session=, :session def cached_session_options #:nodoc: - @session_options ||= read_inheritable_attribute("session_options") || [] + @session_options ||= read_inheritable_attribute(:session_options) || [] end def session_options_for(request, action) #:nodoc: |