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=(new_attributes, *args)\nif new_record? && !@initialized_state_machines\n@initialized_state_machines = true\n\nignore = if new_attributes\nattributes = new_attributes.dup\nattributes.stringify_keys!\nif ::ActiveRecord::VERSION::MAJOR >= 3\nsanitize_for_mass_assignment(attributes).keys\nelse\nremove_attributes_protected_from_mass_assignment(attributes).keys\nend\nelse\n[]\nend\n\ninitialize_state_machines(:dynamic => false, :ignore => ignore)\nsuper\ninitialize_state_machines(:dynamic => true, :ignore => ignore)\nelse\nsuper\nend\nend\n", __FILE__, __LINE__
end