Skip to content

Instantly share code, notes, and snippets.

@ares
Created August 17, 2022 10:22
Show Gist options
  • Save ares/eed2d3428309159a8f6ab2e117053af5 to your computer and use it in GitHub Desktop.
Save ares/eed2d3428309159a8f6ab2e117053af5 to your computer and use it in GitHub Desktop.
diff --git a/app/models/nic/with_attached_devices.rb b/app/models/nic/with_attached_devices.rb
index 6ae1a9b29..749aed2ac 100644
--- a/app/models/nic/with_attached_devices.rb
+++ b/app/models/nic/with_attached_devices.rb
@@ -4,7 +4,7 @@ module Nic::WithAttachedDevices
SEPARATOR = ','
included do
- validates :attached_devices, :format => { :with => /\A[a-z0-9#{SEPARATOR}.:_-]+\Z/ }, :allow_blank => true
+ validates :attached_devices, :format => { :with => /\A[A-Za-z0-9#{SEPARATOR}.:_-]+\Z/ }, :allow_blank => true
validates :identifier, :presence => true, :if => :managed?
before_validation :ensure_virtual
@@ -18,7 +18,7 @@ module Nic::WithAttachedDevices
def attached_devices=(devices)
devices = devices.split(SEPARATOR) if devices.is_a?(String)
- super(devices.map { |i| i.downcase.strip }.join(SEPARATOR))
+ super(devices.map { |i| i.strip }.join(SEPARATOR))
end
def attached_devices_identifiers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment