Module: ConcernsOnRails::Models::Stateable::ClassMethods

Includes:
Support::ColumnGuard
Defined in:
lib/concerns_on_rails/models/stateable.rb

Overview

Defined as a real module (not ‘class_methods do`) so all the private builder helpers live under a single `private` and aren’t constrained by Metrics/BlockLength. ActiveSupport::Concern auto-extends ‘ClassMethods`.

Instance Method Summary collapse

Methods included from Support::ColumnGuard

#ensure_columns!

Instance Method Details

#stateable_by(field, states:, **options) ⇒ Object

Configure the state column. See the module docs for the full DSL.



70
71
72
73
74
75
76
# File 'lib/concerns_on_rails/models/stateable.rb', line 70

def stateable_by(field, states:, **options)
  stateable_configure!(field, states, options)
  stateable_validate!
  stateable_define_states
  stateable_define_transitions
  stateable_apply_default
end