diff --git a/lib/resource_controller/class_methods.rb b/lib/resource_controller/class_methods.rb index f4cb2d5..0a43fdc 100644 --- a/lib/resource_controller/class_methods.rb +++ b/lib/resource_controller/class_methods.rb @@ -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 diff --git a/test/app/controllers/photos_controller.rb b/test/app/controllers/photos_controller.rb index 9471a31..94f820e 100644 --- a/test/app/controllers/photos_controller.rb +++ b/test/app/controllers/photos_controller.rb @@ -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!" }