def attribute_transitioned?(attr, options={})
      options = _transform_options_for_attribute(attr, options)
      !!previous_changes.include?(attr) &&
        (!options.include?(:to) || options[:to] == previous_changes[attr].last) &&
        (!options.include?(:from) || options[:from] == previous_changes[attr].first)
    end
def attribute_transitioned?(attr, options={})
      options = _transform_options_for_attribute(attr, options)
      !!previous_changes.include?(attr) &&
        (!options.include?(:to) || options[:to] == previous_changes[attr].last) &&
        (!options.include?(:from) || options[:from] == previous_changes[attr].first)
    end
:startdoc:
 Returns +true+ if +attribute+ transitioned at the last save event, otherwise +false+.

 You can specify origin and destination states using the +:from+ and +:to+
 options. If +attribute+ is an +ActiveRecord::Enum+, these may be
 specified as either symbol or their native enum value.

  model = Model.create!(status: :complete)
  # => #<Model:0x007fa94844d088 @status=:complete>

  model.status_transitioned?                            # => true
  model.status_transitioned?(from: nil)                 # => true
  model.status_transitioned?(to: :complete)             # => true
  model.status_transitioned?(to: "complete")            # => true
  model.status_transitioned?(from: nil, to: :complete)  # => true