Sha256: b313e0a0cf39ce0c6d999e56b5439aecdabdf18f783a4715b690887e59c44452

Contents?: true

Size: 1.25 KB

Versions: 7

Compression:

Stored size: 1.25 KB

Contents

 # frozen_string_literal: true

HasStates.configure do |config|
  # Configure your models and their state types below
  #
  # Example configuration:
  #
  # config.configure_model User do |model|
  #   # KYC state type with its allowed statuses
  #   model.state_type :kyc do |type|
  #     type.statuses = [
  #       'pending',              # Initial state
  #       'documents_required',   # Waiting for user documents
  #       'under_review',        # Documents being reviewed
  #       'approved',            # KYC process completed successfully
  #       'rejected'             # KYC process failed
  #     ]
  #   end
  #
  #   # Onboarding state type with different statuses
  #   model.state_type :onboarding do |type|
  #     type.statuses = [
  #       'pending',          # Just started
  #       'email_verified',   # Email verification complete
  #       'profile_complete', # User filled all required fields
  #       'completed'         # Onboarding finished
  #     ]
  #   end
  # end
  #
  # config.configure_model Company do |model|
  #   model.state_type :verification do |type|
  #     type.statuses = [
  #       'pending',
  #       'documents_submitted',
  #       'under_review',
  #       'verified',
  #       'rejected'
  #     ]
  #   end
  # end
end

Version data entries

7 entries across 3 versions & 1 rubygems

Version Path
stateful_models-0.0.3 lib/generators/has_states/install/templates/initializer.rb.erb
stateful_models-0.0.3 spec/generators/tmp/config/initializers/has_states.rb
stateful_models-0.0.2 spec/generators/tmp/config/initializers/has_states.rb
stateful_models-0.0.2 spec/dummy/config/initializers/has_states.rb
stateful_models-0.0.2 lib/generators/has_states/install/templates/initializer.rb.erb
stateful_models-0.0.1 lib/generators/has_states/install/templates/initializer.rb.erb
stateful_models-0.0.1 spec/generators/tmp/config/initializers/has_states.rb