diff --git a/app/models/concerns/stateful.rb b/app/models/concerns/stateful.rb index 65b899ecf081f1977394de71f1928a8881a4703d..389bc8efc8a50646a1372bdb0e6bd8be3ca1784c 100644 --- a/app/models/concerns/stateful.rb +++ b/app/models/concerns/stateful.rb @@ -2,7 +2,8 @@ module Stateful extend ActiveSupport::Concern included do - validates_presence_of :state + # validates with accepted states + validates :state, inclusion: { in: %w(draft published suspended) } end def is_published?