Skip to content

Conversation

Art3606
Copy link
Contributor

@Art3606 Art3606 commented Oct 26, 2021

For checking if action exists, was used :all scope instead of :bulkable. Because of this, will-called all policy methods which possibly can raise some errors


def bulk_action
send(params[:bulk_action]) if params[:bulk_action].in?(RailsAdmin::Config::Actions.all(controller: self, abstract_model: @abstract_model).select(&:bulkable?).collect(&:route_fragment))
send(params[:bulk_action]) if params[:bulk_action].in?(RailsAdmin::Config::Actions.all(:bulkable, controller: self, abstract_model: @abstract_model).select(&:bulkable?).collect(&:route_fragment))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.select(&:bulkable?) is no longer necessary, right?

@mshibuya
Copy link
Member

Could you add a test for this fix?

@mshibuya mshibuya added this to the 3.0.0 milestone Dec 26, 2021
@coveralls
Copy link

coveralls commented Jan 22, 2022

Coverage Status

Changes unknown
when pulling ee51f48 on Art3606:bulk_action_fix
into ** on railsadminteam:master**.

@mshibuya
Copy link
Member

This shouldn't be considered as the fix for issue #3404 (just happens to go around it in your setup), but the fix itself makes sense.
After merging in I'll add a test, thanks.

@mshibuya mshibuya merged commit 7cbdddd into railsadminteam:master Jan 22, 2022
mshibuya added a commit that referenced this pull request Jan 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants