aasm / aasm/aasm

reflect state from rails enum

Open
#505 5 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
Ruby
Stars
5.2k
Forks
644
PR merge metrics
No merged PRs in 30d

Description

when use enum: true option, bind all enum item to state automatically, do not repeat you self.

enum state: {
    sleeping: 5,
    running: 99
  }

  aasm :column => :state, :enum => true do
-    state :sleeping, :initial => true
-    state :running
  end

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the ActiveRecord integration and the handling of the enum: true option. Verify how Rails enum values and the AASM state declarations currently interact, then define coverage for the example where enum items are reflected automatically and the explicit state declarations are removed. Done means the example preserves the expected initial state and transitions without duplication.

Written by the indexing model from the issue text.

Assessment

Tech stack
rails, ruby
Domain
backend, databases
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.