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

State predicates should not override existing methods #74

Open
magni- opened this issue Oct 14, 2019 · 0 comments
Open

State predicates should not override existing methods #74

magni- opened this issue Oct 14, 2019 · 0 comments

Comments

@magni-
Copy link

magni- commented Oct 14, 2019

When defining a state machine, Machine#define_state_predicate first checks to see whether the method it would add is already defined or not. However, when defining a state, State#add_predicate does no such check.

We had a machine with a destroyed check work fine until we started to upgrade to Rails 5.2, because that version of Rails adds a check for destroyed? in its create_or_update method.

Ideally, there would be a warning just like there is when defining a state already defined on another state machine on the same model.

edit: from this test case, it looks like this should already work?

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

No branches or pull requests

1 participant