Sha256: f63278d263c5771ac95dbc148d8cc6210f3284b0fded0795edb3466052d65f33

Contents?: true

Size: 348 Bytes

Versions: 3

Compression:

Stored size: 348 Bytes

Contents

module ActiveRecordSurvey
	# Rank in relation to parent/children
	class Node::Answer::Rank < Node::Answer
		# Accept integer or empty values
		def validate_instance_node(instance_node)
			# super - all validations on this node pass
			super &&
			(instance_node.value.to_s.empty? ||
			!instance_node.value.to_s.match(/^\d+$/).nil?)
		end
	end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
active_record_survey-0.1.3 lib/active_record_survey/node/answer/rank.rb
active_record_survey-0.1.2 lib/active_record_survey/node/answer/rank.rb
active_record_survey-0.1.1 lib/active_record_survey/node/answer/rank.rb