Permalink
Browse files

Merge pull request #10 from dweinand/master

Response and callback blocks should not be shared across controllers when using with rails 3
  • Loading branch information...
2 parents 2bc6d89 + ee5ae75 commit 4a87a6a2efc7b7ef7bd8489fc02fcf6137df82df @hcatlin committed Jan 26, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/resourceful/builder.rb
@@ -52,9 +52,12 @@ def apply
kontroller.hidden_actions.reject! &@ok_actions.method(:include?)
kontroller.send :include, @action_module
-
- kontroller.resourceful_callbacks.merge! @callbacks
- kontroller.resourceful_responses.merge! @responses
+
+ merged_callbacks = kontroller.resourceful_callbacks.merge @callbacks
+ merged_responses = kontroller.resourceful_responses.merge @responses
+
+ kontroller.resourceful_callbacks = merged_callbacks
+ kontroller.resourceful_responses = merged_responses
kontroller.made_resourceful = true
kontroller.parents = @parents

0 comments on commit 4a87a6a

Please sign in to comment.