Sha256: 1bfcb7f9b7f26ccd34f630ae961bd8d62e0c7568d4e412c7a9fcb85cc5b69749
Contents?: true
Size: 693 Bytes
Versions: 4
Compression:
Stored size: 693 Bytes
Contents
module ActiveRecordSurvey class Node::Question < Node # Stop validating at the Question node def validate_parent_instance_node(instance_node, child_node) !self.node_validations.collect { |node_validation| node_validation.validate_instance_node(instance_node, self) }.include?(false) end # Build an answer off this node def build_answer(answer_node) # A survey must either be passed or already present in self.node_maps if self.survey.nil? raise ArgumentError.new "A survey must be passed if Question is not yet added to a survey" end # Answers actually define how they're built off the parent node answer_node.send(:build_answer, self) end end end
Version data entries
4 entries across 4 versions & 1 rubygems