app/models/concerns/state_transition_support.rb
# Returns the record's current state
Returns the record's current state
Returns the record ' s current state
def current_state
      current = StateTransition.where(record_id: id, record_type: self.class.to_s, current: true).order(id: :desc).limit(1).first
      if current
        current.to_state.to_sym
      else
        self.initial_state.to_sym
      end
    end
def current_state current = StateTransition . where ( record_id : id , record_type : self . class . to_s , current : true ) . order ( id : :desc ) . limit ( 1 ) . first if current current . to_state . to_sym else self . initial_state . to_sym end end
Returns the record's current state
Returns the record ' s current state