state_machine

https://github.com/pluginaweek/state_machine

Ruby

Adds support for creating state machines for attributes on any Ruby class

StateMachine::Machine#define_scopes

Defines the with/without scope helpers for this attribute.  Both the
singular and plural versions of the attribute are defined for each
scope helper.  A custom plural can be specified if it cannot be
automatically determined by either calling +pluralize+ on the attribute
name or adding an "s" to the end of the name.

Source | Google | Stack overflow

Edit

git clone [email protected]:pluginaweek/state_machine.git

cd state_machine

open lib/state_machine/machine.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-StateMachine--Machine-define_scopes-for-pr


# Commit to git

git add lib/state_machine/machine.rbgit commit -m "better docs for StateMachine::Machine#define_scopes"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-StateMachine--Machine-define_scopes-for-pr

hub pull-request


# Celebrate!