mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 16:09:52 +01:00
dragons
This commit is contained in:
parent
9fe8be1db8
commit
88e9d7599d
1 changed files with 8 additions and 0 deletions
|
@ -33,6 +33,14 @@ class User < ActiveRecord::Base
|
|||
|
||||
# validates :website, format: { with: WEBSITE_REGEX }
|
||||
|
||||
before_save do
|
||||
self.website = if website.match %r{\Ahttps?://}
|
||||
website
|
||||
else
|
||||
"http://#{website}"
|
||||
end unless website.blank?
|
||||
end
|
||||
|
||||
def login=(login)
|
||||
@login = login
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue