class AASM::InstanceBase

def event_exists?(event_name, bang = false)

def event_exists?(event_name, bang = false)
  event = @instance.class.aasm(@name).state_machine.events[event_name.to_sym]
  return true if event
  event_error = bang ? "#{event_name}!" : event_name
  raise AASM::UndefinedEvent, "Event :#{event_error} doesn't exist" if event.nil?
end