```ruby
module AASMWithFixes
  def self.included(base)
    base.send(:include, AASM)
    base.module_eval do
      class << self
        def inherited(child)
          AASM::StateMachine[child] = AASM::StateMachine[self].clone
          AASM::StateMachine[child].events = AASM::StateMachine[self].events.clone
          super
        end
      end
    end
  end
end```

Update monkey patch to work with AASM 2.0.5
user
```ruby
module AASM
  class StateMachine
    def clone
      klone = super
      klone.states = states.clone
      klone.events = events.clone
      klone
    end
  end
end

module AASMWithFixes
  def self.included(base)
    base.send(:include, AASM)
  end
end
```
assistant