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!, #ensure_columns_on!, #schema_reachable?

Instance Method Details

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

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



76
77
78
79
80
81
82
# File 'lib/concerns_on_rails/models/stateable.rb', line 76

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