Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461862
name_validator.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, May 18, 6:44 PM
Size
225 B
Mime Type
text/x-ruby
Expires
Tue, May 20, 6:44 PM (1 d, 13 h)
Engine
blob
Format
Raw Data
Handle
220327
Attached To
rARCHIVING archiving
name_validator.rb
View Options
class
NameValidator
<
ActiveModel
::
Validator
def
validate
(
record
)
unless
record
.
name
=~
/^[a-zA-Z0-1\.-_ ]+$/
record
.
errors
[
:name
]
<<
"Can only contain numbers, letters, space, '.', '-' and '_'"
end
end
end
Event Timeline
Log In to Comment