# File lib/state_machine/node_collection.rb, line 73 def update(node) @indices.each do |attribute, index| old_key = RUBY_VERSION < '1.9' ? index.index(node) : index.key(node) new_key = value(node, attribute) # Only replace the key if it's changed if old_key != new_key index.delete(old_key) index[new_key] = node end end end