mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
parent
968a59cd3d
commit
a5c0333a5d
2 changed files with 17 additions and 1 deletions
|
@ -35,6 +35,7 @@ module Registry
|
|||
# Autoload all model subdirs
|
||||
config.autoload_paths += Dir[Rails.root.join('app', 'models', '**/')]
|
||||
config.autoload_paths << Rails.root.join('lib')
|
||||
config.eager_load_paths << config.root.join('lib', 'validators')
|
||||
|
||||
# Add the fonts path
|
||||
config.assets.paths << Rails.root.join('vendor', 'assets', 'fonts')
|
||||
|
|
15
lib/validators/email_validator.rb
Normal file
15
lib/validators/email_validator.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
class EmailValidator
|
||||
def self.regexp
|
||||
Devise::email_regexp
|
||||
end
|
||||
|
||||
def initialize(email)
|
||||
@email = email
|
||||
end
|
||||
|
||||
def valid?
|
||||
email =~ self.class.regexp
|
||||
end
|
||||
|
||||
attr_reader :email
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue