Changeset 2527
- Timestamp:
- 10/11/05 01:53:31 (3 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/session_management.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r2524 r2527 1 1 *SVN* 2 3 * Speed improvement for session_options. #2287. [skaes@web.de] 2 4 3 5 * Make cacheing binary files friendly with Windows. #1975. [Rich Olson] trunk/actionpack/lib/action_controller/session_management.rb
r2230 r2527 78 78 end 79 79 80 def cached_session_options 81 @session_options ||= read_inheritable_attribute("session_options") || [] 82 end 83 80 84 def session_options_for(request, action) #:nodoc: 81 options = {} 85 if (session_options = cached_session_options).empty? 86 {} 87 else 88 options = {} 82 89 83 action = action.to_s 84 (read_inheritable_attribute("session_options") || []).each do |opts| 85 next if opts[:if] && !opts[:if].call(request) 86 if opts[:only] && opts[:only].include?(action) 87 options.merge!(opts) 88 elsif opts[:except] && !opts[:except].include?(action) 89 options.merge!(opts) 90 elsif !opts[:only] && !opts[:except] 91 options.merge!(opts) 90 action = action.to_s 91 session_options.each do |opts| 92 next if opts[:if] && !opts[:if].call(request) 93 if opts[:only] && opts[:only].include?(action) 94 options.merge!(opts) 95 elsif opts[:except] && !opts[:except].include?(action) 96 options.merge!(opts) 97 elsif !opts[:only] && !opts[:except] 98 options.merge!(opts) 99 end 100 end 101 102 if options.empty? then options 103 else 104 options.delete :only 105 options.delete :except 106 options.delete :if 107 options[:disabled] ? false : options 92 108 end 93 109 end 94 95 options.delete :only96 options.delete :except97 options.delete :if98 99 options[:disabled] ? false : options100 110 end 101 111 end … … 109 119 private 110 120 def clear_persistant_model_associations #:doc: 111 session = @session.instance_variable_get("@data") 112 session.each { |key, obj| obj.clear_association_cache if obj.respond_to?(:clear_association_cache) } if session 121 if session = @session.instance_variable_get("@data") 122 session.each { |key, obj| obj.clear_association_cache if obj.respond_to?(:clear_association_cache) } 123 end 113 124 end 114 125 end