| ... | ... | @@ -41,7 +41,8 @@ |
|
|
|
# confirmed_at :datetime
|
|
|
|
# confirmation_sent_at :datetime
|
|
|
|
# unconfirmed_email :string(255)
|
|
|
|
# hide_no_ssh_key :boolean default(FALSE), not null
|
|
|
|
# hide_no_ssh_key :boolean default(FALSE)
|
|
|
|
# website_url :string(255) default(""), not null
|
|
|
|
#
|
|
|
|
|
|
|
|
require 'carrierwave/orm/activerecord'
|
| ... | ... | @@ -52,7 +53,7 @@ class User < ActiveRecord::Base |
|
|
|
:recoverable, :rememberable, :trackable, :validatable, :omniauthable, :confirmable, :registerable
|
|
|
|
|
|
|
|
attr_accessible :email, :password, :password_confirmation, :remember_me, :bio, :name, :username,
|
|
|
|
:skype, :linkedin, :twitter, :color_scheme_id, :theme_id, :force_random_password,
|
|
|
|
:skype, :linkedin, :twitter, :website_url, :color_scheme_id, :theme_id, :force_random_password,
|
|
|
|
:extern_uid, :provider, :password_expires_at, :avatar, :hide_no_ssh_key,
|
|
|
|
as: [:default, :admin]
|
|
|
|
|
| ... | ... | @@ -424,4 +425,14 @@ class User < ActiveRecord::Base |
|
|
|
order('id DESC').limit(1000).
|
|
|
|
update_all(updated_at: Time.now)
|
|
|
|
end
|
|
|
|
|
|
|
|
def full_website_url
|
|
|
|
return "http://#{website_url}" if website_url !~ /^https?:\/\//
|
|
|
|
|
|
|
|
website_url
|
|
|
|
end
|
|
|
|
|
|
|
|
def short_website_url
|
|
|
|
website_url.gsub(/https?:\/\//, '')
|
|
|
|
end
|
|
|
|
end |