diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-10-16 22:20:32 +0200 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-10-16 22:20:32 +0200 |
commit | 0242d817035e60357e559af0e9441a1f24a764e4 (patch) | |
tree | 1efa579fc261e55f76bacfa9818eb4a649d68294 /actionpack/lib/action_controller | |
parent | 7e2777348b88bf096ebc51e364554af19d7bcc55 (diff) | |
parent | 9cb5400871b660e2c6d1654346650f07bb52a0c0 (diff) | |
download | rails-0242d817035e60357e559af0e9441a1f24a764e4.tar.gz rails-0242d817035e60357e559af0e9441a1f24a764e4.tar.bz2 rails-0242d817035e60357e559af0e9441a1f24a764e4.zip |
Merge with mainstream rails
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/routing/builder.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 3 |
3 files changed, 7 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 413f6d48e5..3ede681253 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -969,7 +969,9 @@ module ActionController #:nodoc: # If-Modified-Since request header is <= last modified. def last_modified!(utc_time) response.last_modified= utc_time - head(:not_modified) if response.last_modified == request.if_modified_since + if request.if_modified_since && request.if_modified_since <= utc_time + head(:not_modified) + end end # Sets the ETag response header. Returns 304 Not Modified if the diff --git a/actionpack/lib/action_controller/routing/builder.rb b/actionpack/lib/action_controller/routing/builder.rb index 5704d9d01a..7b888fa8d2 100644 --- a/actionpack/lib/action_controller/routing/builder.rb +++ b/actionpack/lib/action_controller/routing/builder.rb @@ -60,12 +60,10 @@ module ActionController # segments are passed alongside in order to distinguish between default values # and requirements. def divide_route_options(segments, options) - options = options.dup + options = options.except(:path_prefix, :name_prefix) if options[:namespace] options[:controller] = "#{options.delete(:namespace).sub(/\/$/, '')}/#{options[:controller]}" - options.delete(:path_prefix) - options.delete(:name_prefix) end requirements = (options.delete(:requirements) || {}).dup diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 6a39039504..4fc60f0697 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -134,6 +134,9 @@ module ActionController @controller = self.class.controller_class.new @controller.request = @request = TestRequest.new @response = TestResponse.new + + @controller.params = {} + @controller.send(:initialize_current_url) end # Cause the action to be rescued according to the regular rules for rescue_action when the visitor is not local |