lib/active_record_survey/node.rb
def answers
			nm = self.survey.node_maps

			next_answer_nodes = lambda { |node, list|
				nm.select { |node_map|
					!node_map.parent.nil? && node_map.parent.node == node && node_map.node.class.ancestors.include?(::ActiveRecordSurvey::Node::Answer) && !node_map.marked_for_destruction?
				}.select { |i|
					!list.include?(i.node)
				}.collect { |i|
					i.survey = self.survey
					i.node.survey = self.survey

					list << i.node

					next_answer_nodes.call(i.node, list)
				}.flatten.uniq

				list
			}
			next_answer_nodes.call(self, []).flatten.uniq
		end
def answers
			nm = self.survey.node_maps

			next_answer_nodes = lambda { |node, list|
				nm.select { |node_map|
					!node_map.parent.nil? && node_map.parent.node == node && node_map.node.class.ancestors.include?(::ActiveRecordSurvey::Node::Answer) && !node_map.marked_for_destruction?
				}.select { |i|
					!list.include?(i.node)
				}.collect { |i|
					i.survey = self.survey
					i.node.survey = self.survey

					list << i.node

					next_answer_nodes.call(i.node, list)
				}.flatten.uniq

				list
			}
			next_answer_nodes.call(self, []).flatten.uniq
		end
prepend is important! otherwise dependent: :destroy on node<->node_map relation is executed first and no records!
 All the answer nodes that follow from this node