Closed spinosa closed 11 years ago
@spinosa I don't think it will completely solve that problem. See #175
Yes @iceberg901, this won't address the issues presented by #175. But for users that do return faux
this will make sure their public roll has all the expected metadata.
(for my own reference) running this code:
to_skip = 6_700_000
User.sort(:_id.asc).where(:faux => 1).limit(500_000).skip(to_skip).find_each.each do |u|
unless GT::UserManager.user_has_all_special_roll_ids?(u)
puts "Fixing user w/o special rolls #{u.nickname} (#{u.id})"
GT::UserManager.ensure_users_special_rolls(u, true)
end
if !u.public_roll.origin_network
puts "Adding origin network for User(#{u.id}) / #{u.authentications[0].provider} / #{u.created_at}"
u.public_roll.update_attribute(:origin_network, u.authentications[0].provider)
end
end
TODO: handle fucked up User case for the block above (with to_skip = 6_500_000
):
NoMethodError: undefined method 'origin_network' for nil:NilClass
ran this for all users, have a code fix coming that should address it going forward.
slowly
Find, in batches, all users where
faux == 1
and then runu.public_roll.update_attribute(:origin_network, u.authentications[0].provider)
This will fix the issue @matyus (and possibly others) have seen with the occasional faux user not showing up as such on the front end.