|
|
@ -209,7 +209,7 @@ class User < Principal
|
|
|
|
validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
|
|
|
|
validates_inclusion_of :mail_notification, :in => MAIL_NOTIFICATION_OPTIONS.collect(&:first), :allow_blank => true
|
|
|
|
validate :validate_password_length
|
|
|
|
validate :validate_password_length
|
|
|
|
# validates_email_realness_of :mail
|
|
|
|
# validates_email_realness_of :mail
|
|
|
|
before_create :set_mail_notification, :sync_gitlab_user
|
|
|
|
before_create :set_mail_notification
|
|
|
|
before_save :update_hashed_password
|
|
|
|
before_save :update_hashed_password
|
|
|
|
before_destroy :remove_references_before_destroy
|
|
|
|
before_destroy :remove_references_before_destroy
|
|
|
|
# added by fq
|
|
|
|
# added by fq
|
|
|
@ -218,6 +218,8 @@ class User < Principal
|
|
|
|
# 更新邮箱用户或用户名的同事,同步更新邀请信息
|
|
|
|
# 更新邮箱用户或用户名的同事,同步更新邀请信息
|
|
|
|
after_update :update_invite_list
|
|
|
|
after_update :update_invite_list
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
include Trustie::Gitlab::ManageUser
|
|
|
|
|
|
|
|
|
|
|
|
scope :in_group, lambda {|group|
|
|
|
|
scope :in_group, lambda {|group|
|
|
|
|
group_id = group.is_a?(Group) ? group.id : group.to_i
|
|
|
|
group_id = group.is_a?(Group) ? group.id : group.to_i
|
|
|
|
where("#{User.table_name}.id IN (SELECT gu.user_id FROM #{table_name_prefix}groups_users#{table_name_suffix} gu WHERE gu.group_id = ?)", group_id)
|
|
|
|
where("#{User.table_name}.id IN (SELECT gu.user_id FROM #{table_name_prefix}groups_users#{table_name_suffix} gu WHERE gu.group_id = ?)", group_id)
|
|
|
|