Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails 5.1 compatibility #4

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/devise/deactivate_controller.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Devise::DeactivateController < DeviseController
prepend_before_filter :authenticate_deactivatee!
prepend_before_action :authenticate_deactivatee!

# POST /resource/deactivate
def create
Expand Down Expand Up @@ -28,4 +28,4 @@ def after_deactivate_path_for(resource_name)
new_session_path(resource_name) if is_navigational_format?
end

end
end
11 changes: 3 additions & 8 deletions lib/devise_deactivatable/mapping.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
module DeviceDeactivatable
module Mapping
def self.included(base)
base.alias_method_chain :default_controllers, :deactivatable
end

private
def default_controllers_with_deactivatable(options)
def default_controllers(options)
options[:controllers] ||= {}
default_controllers_without_deactivatable(options)
super(options)
end
end
end
end
2 changes: 1 addition & 1 deletion lib/devise_deactivatable/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Engine < ::Rails::Engine
end

config.after_initialize do
Devise::Mapping.send :include, DeviceDeactivatable::Mapping
Devise::Mapping.send :prepend, DeviceDeactivatable::Mapping
end
end
end