state_machine
https://github.com/pluginaweek/state_machine
Ruby
Adds support for creating state machines for attributes on any Ruby class
StateMachine::Integrations::ActiveModel#translate
Translates the given key / value combo. Translation keys are looked
up in the following order:
* <tt>#{i18n_scope}.state_machines.#{model_name}.#{machine_name}.#{plural_key}.#{value}</tt>
* <tt>#{i18n_scope}.state_machines.#{model_name}.#{plural_key}.#{value}</tt>
* <tt>#{i18n_scope}.state_machines.#{machine_name}.#{plural_key}.#{value}</tt>
* <tt>#{i18n_scope}.state_machines.#{plural_key}.#{value}</tt>
If no keys are found, then the humanized value will be the fallback.Edit
git clone [email protected]:pluginaweek/state_machine.git
cd state_machine
open lib/state_machine/integrations/active_model.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-StateMachine--Integrations--ActiveModel-translate-for-pr
# Commit to gitgit add lib/state_machine/integrations/active_model.rbgit commit -m "better docs for StateMachine::Integrations::ActiveModel#translate"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-StateMachine--Integrations--ActiveModel-translate-for-pr
hub pull-request
# Celebrate!