# File app/models/smerf_group.rb, line 54 def validate # Decode the raw data decode_data() # Validate all fields present errors = validate_object_fields() # Process question for this group @question_objects = nil if (!@questions.nil? and !@questions.empty?) # Process and validate questions @question_objects = Array.new errors += validate_sub_objects(SmerfQuestion, @questions, "sort_order", @question_objects) end # Clear data no longer required, this will reduce the amount of data # saved to the DB cleanup() remove_instance_variable(:@questions) return errors end