Skip to content

Commit

Permalink
update how we're checking whether a method is defined, and add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgolick committed Nov 29, 2008
1 parent ee643a0 commit 2b261bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/resource_controller/class_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def actions(*opts)
actions_to_remove += [*config[:except]] if config[:except]
actions_to_remove.uniq!

actions_to_remove.each { |action| undef_method(action) if instance_methods.include?(action.to_s) }
actions_to_remove.each { |action| undef_method(action) if method_defined?(action) }
end

end
Expand Down
1 change: 1 addition & 0 deletions test/app/controllers/photos_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
class PhotosController < ResourceController::Base
actions :all, :except => :update
actions :all, :except => :update

belongs_to :user
create.flash { "#{@photo.title} was created!" }
Expand Down

0 comments on commit 2b261bc

Please sign in to comment.