Skip to content

Commit

Permalink
Calling super from AASM.included
Browse files Browse the repository at this point in the history
Reason for this is rails gets uppity if you include AASM in a model, then subclass that model (STI.) You can end up with "can't dup NilClass" errors and it's all very confusing.

Calling super is considered playing nicely with other code anyway.
  • Loading branch information
caius authored and ttilley committed Aug 27, 2010
1 parent ef61951 commit 20de42d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/aasm/aasm.rb
Expand Up @@ -11,6 +11,7 @@ def self.included(base) #:nodoc:
unless AASM::StateMachine[base]
AASM::StateMachine[base] = AASM::StateMachine.new('')
end
super
end

module ClassMethods
Expand Down

0 comments on commit 20de42d

Please sign in to comment.