解决数据同步问题(历史邮件通知validate问题)

This commit is contained in:
huang 2015-10-29 12:33:22 +08:00
parent b0aee8c92f
commit bf06a6cafd
2 changed files with 5 additions and 2 deletions

View File

@ -7,7 +7,7 @@ namespace :gitlab do
# User.where(username: 'root').find_each do |user| # User.where(username: 'root').find_each do |user|
s = Trustie::Gitlab::Sync.new s = Trustie::Gitlab::Sync.new
User.find_each do |user| User.find_each do |user|
s.sync_user(user) s.sync_user(user)
end end
end end

View File

@ -22,7 +22,10 @@ module Trustie
def sync_user(user) def sync_user(user)
u = add_user(user) u = add_user(user)
user.save! if u if user.mail_notification.blank? or user.mail_notification == "only_assigned" or user.mail_notification == "only_my_events"
user.mail_notification = "day"
end
user.save!
end end
def sync_project(project, opt={}) def sync_project(project, opt={})