Sha256: 92c99c9ad4b7599519e2abca905a9bdea4b05f20c5a5b509c7500ac0656b5eb0

Contents?: true

Size: 360 Bytes

Versions: 7

Compression:

Stored size: 360 Bytes

Contents

module ActiveRecordSurvey
	# Ensure the instance_node has a value less than the maximum
	class NodeValidation::MaximumValue < NodeValidation
		# Validate the instance_node value is less than the maximum
		def validate_instance_node(instance_node, node = nil)
			!instance_node.value.to_s.empty? &&
			instance_node.value.to_f <= self.value.to_f
		end
	end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
active_record_survey-0.1.7 lib/active_record_survey/node_validation/maximum_value.rb
active_record_survey-0.1.6 lib/active_record_survey/node_validation/maximum_value.rb
active_record_survey-0.1.5 lib/active_record_survey/node_validation/maximum_value.rb
active_record_survey-0.1.4 lib/active_record_survey/node_validation/maximum_value.rb
active_record_survey-0.1.3 lib/active_record_survey/node_validation/maximum_value.rb
active_record_survey-0.1.2 lib/active_record_survey/node_validation/maximum_value.rb
active_record_survey-0.1.1 lib/active_record_survey/node_validation/maximum_value.rb