Skip to content

Add prevent_transition as an exclusive next to permit_transition #8

Description

@svanhesteren

Sometimes you have a whole list of state transitions and you just want to disallow one or two instead of writing out all possible combinations.
Like this:

  state_machine_enum :state, prefix: "state" do |s|
    s.prevent_transition(:unavailable, :unpublished)
  end

Having the posibility to spec the inverse would be cleaner, just like rails does it in various places with :allow, :except.
I understand this could be a bit involved since it would be nice to check we don't have conflicting rules. In that case an exception could be raised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions