Skip to content

Add from_states_for_event and to_states_for_event methods#792

Open
steamwings wants to merge 1 commit into
aasm:masterfrom
steamwings:feature/states_for_event
Open

Add from_states_for_event and to_states_for_event methods#792
steamwings wants to merge 1 commit into
aasm:masterfrom
steamwings:feature/states_for_event

Conversation

@steamwings

@steamwings steamwings commented Aug 24, 2022

Copy link
Copy Markdown

Hi, I'm new to AASM and just recently started using it.

What does this do?

  • Add from_states_for_event method to AASM::Base
  • Add to_states_for_event method to AASM::Base
  • Add respective unit tests

Use case

In my case, I want to create a message indicating which states an object must be in to progress to another state. I ended up writing the code for from_states_for_event and figured it would be nice to have it as an integrated helper.

to_states_for_event is included as a bonus.

Specs passing?

Yes. I ran them all with docker-compose as suggested--except for the rails 4.2 ones due to bundler issues. Also, I had to make a couple small changes to Dockerfile and docker-compose.yml to get them to run on the arm64v8 architecture. Those changes are not included with the PR.

@qlty-cloud-legacy

Copy link
Copy Markdown

Code Climate has analyzed commit db0a30c and detected 0 issues on this pull request.

View more on Code Climate.

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.

1 participant