aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorMike Gunderloy <MikeG1@larkfarm.com>2009-03-05 18:46:59 -0600
committerJoshua Peek <josh@joshpeek.com>2009-03-05 18:46:59 -0600
commit5b7527ca44521edf9782b3d7f449bf09a29267f2 (patch)
tree8b6f7eca846a0e8e17e36146d6576cc430552973 /actionpack/lib/action_controller
parentb1c989f28dd1d619f0e3e3ca1b894b686e517f2f (diff)
downloadrails-5b7527ca44521edf9782b3d7f449bf09a29267f2.tar.gz
rails-5b7527ca44521edf9782b3d7f449bf09a29267f2.tar.bz2
rails-5b7527ca44521edf9782b3d7f449bf09a29267f2.zip
Failing test for routes with member & requirement [#2054 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/resources.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/resources.rb b/actionpack/lib/action_controller/resources.rb
index 3af21967df..8195b38685 100644
--- a/actionpack/lib/action_controller/resources.rb
+++ b/actionpack/lib/action_controller/resources.rb
@@ -670,7 +670,12 @@ module ActionController
when "show", "edit"; default_options.merge(add_conditions_for(resource.conditions, method || :get)).merge(resource.requirements(require_id))
when "update"; default_options.merge(add_conditions_for(resource.conditions, method || :put)).merge(resource.requirements(require_id))
when "destroy"; default_options.merge(add_conditions_for(resource.conditions, method || :delete)).merge(resource.requirements(require_id))
- else default_options.merge(add_conditions_for(resource.conditions, method)).merge(resource.requirements)
+ else
+ if method.nil? || resource.member_methods.nil? || resource.member_methods[method.to_sym].nil?
+ default_options.merge(add_conditions_for(resource.conditions, method)).merge(resource.requirements)
+ else
+ resource.member_methods[method.to_sym].include?(action) ? default_options.merge(add_conditions_for(resource.conditions, method)).merge(resource.requirements(require_id)) : default_options.merge(add_conditions_for(resource.conditions, method)).merge(resource.requirements)
+ end
end
end
end