class DefraRuby::Validators::LocationValidator
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/defra_ruby/validators/location_validator.rb, line 8 def validate_each(record, attribute, value) value_is_included?(record, attribute, value, valid_options) end
Private Instance Methods
allow_overseas?()
click to toggle source
# File lib/defra_ruby/validators/location_validator.rb, line 21 def allow_overseas? options[:allow_overseas] == true end
valid_options()
click to toggle source
# File lib/defra_ruby/validators/location_validator.rb, line 14 def valid_options options = %w[england northern_ireland scotland wales] options.push("overseas") if allow_overseas? options end