def define_state_initializer
@instance_helper_module.class_eval "# Ensure that the attributes setter gets used to force initialization\n# of the state machines\ndef initialize(attributes = nil, *args)\nattributes ||= {}\nsuper\nend\n\n# Hooks in to attribute initialization to set the states *prior*\n# to the attributes being set\ndef attributes=(*args)\nif new_record? && !@initialized_state_machines\n@initialized_state_machines = true\n\ninitialize_state_machines(:dynamic => false)\nsuper\ninitialize_state_machines(:dynamic => true)\nelse\nsuper\nend\nend\n", __FILE__, __LINE__
end