Merge pull request #51 from ernie/intialize-copy
Use Ruby's initialize_copy for clone/dup
This commit is contained in:
commit
21394075f2
|
@ -19,11 +19,10 @@ module AASM
|
|||
@config = OpenStruct.new
|
||||
end
|
||||
|
||||
def clone
|
||||
klone = super
|
||||
klone.states = states.clone
|
||||
klone.events = events.clone
|
||||
klone
|
||||
def initialize_copy(orig)
|
||||
super
|
||||
@states = @states.dup
|
||||
@events = @events.dup
|
||||
end
|
||||
|
||||
def create_state(name, options)
|
||||
|
|
Loading…
Reference in New Issue