diff --git a/lib/active_admin_paranoia/dsl.rb b/lib/active_admin_paranoia/dsl.rb index 5512a3c..06f4c2e 100644 --- a/lib/active_admin_paranoia/dsl.rb +++ b/lib/active_admin_paranoia/dsl.rb @@ -12,7 +12,8 @@ def find_resource options = { notice: I18n.t('active_admin.batch_actions.succesfully_destroyed', count: ids.count, model: resource_class.to_s.camelize.constantize.model_name, plural_model: resource_class.to_s.downcase.pluralize) } # For more info, see here: https://github.com/rails/rails/pull/22506 if Rails::VERSION::MAJOR >= 5 - redirect_back({ fallback_location: ActiveAdmin.application.root_to }.merge(options)) + args = { fallback_location: ActiveAdmin.application.root_to }.merge(options) + redirect_back(**args) else redirect_to :back, options end @@ -23,7 +24,8 @@ def find_resource options = { notice: I18n.t('active_admin_paranoia.batch_actions.succesfully_restored', count: ids.count, model: resource_class.to_s.camelize.constantize.model_name, plural_model: resource_class.to_s.downcase.pluralize) } # For more info, see here: https://github.com/rails/rails/pull/22506 if Rails::VERSION::MAJOR >= 5 - redirect_back({ fallback_location: ActiveAdmin.application.root_to }.merge(options)) + args = { fallback_location: ActiveAdmin.application.root_to }.merge(options) + redirect_back(**args) else redirect_to :back, options end @@ -38,7 +40,8 @@ def find_resource options = { notice: I18n.t('active_admin_paranoia.batch_actions.succesfully_restored', count: 1, model: resource_class.to_s.camelize.constantize.model_name, plural_model: resource_class.to_s.downcase.pluralize) } # For more info, see here: https://github.com/rails/rails/pull/22506 if Rails::VERSION::MAJOR >= 5 - redirect_back({ fallback_location: ActiveAdmin.application.root_to }.merge(options)) + args = { fallback_location: ActiveAdmin.application.root_to }.merge(options) + redirect_back(**args) else redirect_to :back, options end