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

Improve the developer experience with the new Ability deprecations #3801

Merged
merged 4 commits into from
Oct 23, 2020

Conversation

elia
Copy link
Member

@elia elia commented Oct 20, 2020

Description

Currently the :read ability is used in many places that trigger the deprecation without leaving the dev a chance to fix it.
It also points to the line in which the warning is issued instead of the line calling #can?.

This PR fixes both problems.

Checklist:

  • I have followed Pull Request guidelines
  • I have added a detailed description into each commit message
  • I have updated Guides and README accordingly to this change (if needed)
  • I have added tests to cover this change (if needed)
  • I have attached screenshots to this PR for visual changes (if needed)

elia added 2 commits October 23, 2020 11:05
The :read action generates a deprecation for end users that can't be
solved from within the application.
This change will target the actual line that called #can? instead of
the line in which the deprecation was issued (i.e. ability.rb:44).
@elia elia force-pushed the elia/ability-deprecations-fixes branch from 1d6b9e8 to deaba24 Compare October 23, 2020 09:11
elia added 2 commits October 23, 2020 11:12
The wording and rendering of action names is more consistent and adds
clear directions about what needs to be done to fix the issue.
The standard name is actually :destroy, and the custom one :delete.
@elia elia force-pushed the elia/ability-deprecations-fixes branch from deaba24 to 915ffa3 Compare October 23, 2020 09:12
@elia elia marked this pull request as ready for review October 23, 2020 09:44
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

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

👍

Copy link
Member

@spaghetticode spaghetticode left a comment

Choose a reason for hiding this comment

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

@elia thanks! 👍

@kennyadsl kennyadsl merged commit fbc3597 into solidusio:master Oct 23, 2020
@kennyadsl kennyadsl deleted the elia/ability-deprecations-fixes branch October 23, 2020 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants