{"id":19651126,"url":"https://github.com/mnutt/acts_as_state_machine","last_synced_at":"2025-10-03T15:22:02.116Z","repository":{"id":535245,"uuid":"164529","full_name":"mnutt/acts_as_state_machine","owner":"mnutt","description":"acts_as_state_machine","archived":false,"fork":false,"pushed_at":"2009-03-31T20:32:29.000Z","size":100,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-09T23:54:02.865Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnutt.png","metadata":{"files":{"readme":"README","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2009-03-31T20:32:10.000Z","updated_at":"2019-08-13T14:14:06.000Z","dependencies_parsed_at":"2022-07-14T12:01:43.744Z","dependency_job_id":null,"html_url":"https://github.com/mnutt/acts_as_state_machine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnutt%2Facts_as_state_machine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnutt%2Facts_as_state_machine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnutt%2Facts_as_state_machine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnutt%2Facts_as_state_machine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnutt","download_url":"https://codeload.github.com/mnutt/acts_as_state_machine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240959908,"owners_count":19885045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T15:05:22.425Z","updated_at":"2025-10-03T15:21:57.077Z","avatar_url":"https://github.com/mnutt.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"= Acts As State Machine\n\nThis act gives an Active Record model the ability to act as a finite state\nmachine (FSM).\n\nAcquire via subversion at:\n\nhttp://elitists.textdriven.com/svn/plugins/acts_as_state_machine/trunk\n\nIf prompted, use the user/pass anonymous/anonymous.\n\n== Example\n\n class Order \u003c ActiveRecord::Base\n   acts_as_state_machine :initial =\u003e :opened\n\n   state :opened\n   state :closed, :enter =\u003e Proc.new {|o| Mailer.send_notice(o)}\n   state :returned\n\n   event :close do\n     transitions :to =\u003e :closed, :from =\u003e :opened\n   end\n\n   event :return do\n     transitions :to =\u003e :returned, :from =\u003e :closed\n   end\n end\n\n o = Order.create\n o.close! # notice is sent by mailer\n o.return!\n\nThis version of State Machine will additionally create named scopes for your states - referring to the above example\n\nOrder.opened will return all orders with a state of opened\nOrder.closed will return all models with a state of closed\n\nand so on \n\nFor more information on named scopes see \nhttp://railscasts.com/episodes/108","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnutt%2Facts_as_state_machine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnutt%2Facts_as_state_machine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnutt%2Facts_as_state_machine/lists"}