Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Changeset [fee9487e0d5464fc328f1c9c91eb059fef75988e] by Tim Pope

Revision fee9487e0d5464fc328f1c9c91eb059fef75988e, committed by Tim Pope · October 9th, 2008 @ 07:03 PM

Invoke original inherited callback when subclassed

When AASM is included into a class, it defines inherited, clobbering the original definition. This problem becomes readily apparent with STI in Rails, where the original method is part of the implementation of inheritable attributes, a feature relied on for several ActiveRecord features such as callbacks and timestamp recording.

Move the implementation of inherited to ClassMethods and invoke the original method via super. http://github.com/rubyist/aasm/c...

2 changed files

  • M lib/aasm.rb
  • M spec/unit/aasm_spec.rb