Sha256: 253666c8efafd7a15e704af174171e2cb4f48260d38eef60b441e7c551e4dc98

Contents?: true

Size: 368 Bytes

Versions: 42

Compression:

Stored size: 368 Bytes

Contents

# frozen_string_literal: true

module Thredded
  # Defines a moderation_state enum
  # Requires an integer moderation_state column on the including class.
  module ModerationState
    extend ActiveSupport::Concern

    included do
      enum moderation_state: %i[pending_moderation approved blocked]
      validates :moderation_state, presence: true
    end
  end
end

Version data entries

42 entries across 42 versions & 2 rubygems

Version Path
thredded-1.1.0 app/models/concerns/thredded/moderation_state.rb
thredded-1.0.1 app/models/concerns/thredded/moderation_state.rb
thredded-1.0.0 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.16 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.15 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.14 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.13 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.12 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.11 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.10 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.9 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.8 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.7 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.6 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.5 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.4 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.3 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.1 app/models/concerns/thredded/moderation_state.rb
thredded-0.16.0 app/models/concerns/thredded/moderation_state.rb
thredded-0.15.5 app/models/concerns/thredded/moderation_state.rb