def enum(definitions, &block)
      prefix, suffix = definitions[:_prefix], definitions[:_suffix] if Rails::VERSION::STRING >= '5'
      enum = super definitions

      if block
        definitions.each_key do |column|
          states = enum[column]
          @_stateful_enum = StatefulEnum::Machine.new self, column, (states.is_a?(Hash) ? states.keys : states), prefix, suffix, &block
        end
      end
    end
def enum(definitions, &block)
      prefix, suffix = definitions[:_prefix], definitions[:_suffix] if Rails::VERSION::STRING >= '5'
      enum = super definitions

      if block
        definitions.each_key do |column|
          states = enum[column]
          @_stateful_enum = StatefulEnum::Machine.new self, column, (states.is_a?(Hash) ? states.keys : states), prefix, suffix, &block
        end
      end
    end
enum status: {unassigned: 0, assigned: 1, resolved: 2, closed: 3} do
     event :assign do
       transition :unassigned => :assigned
     end
   end