Refactored has_states to use new find_direct_children_by_attributes method.