Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- company_users_data = {
- 387770 => 220080,
- 251270 => 280,
- 234938 => 280,
- 514522 => 221609,
- 32472 => 24721,
- 750763 => 24721,
- 7688 => 5365,
- 33107 => 25236,
- 130705 => 84267,
- 665658 => 236293,
- 699926 => 249630,
- 383330 => 216379,
- 102936 => 75667,
- 716451 => 227720,
- 492492 => 227720,
- 141311 => 103129,
- 220785 => 49377,
- 125092 => 2928,
- 22624 => 2928,
- 688020 => 2928,
- 208720 => 2928,
- 73469 => 2928,
- 159969 => 2928,
- 193718 => 2928,
- 374975 => 2928,
- 72648 => 2928,
- 128467 => 2928
- }
- setting = Setting.find_or_create_by(name: 'pipeline_view_settings')
- company_users_data.each do |company_user_id, company_id|
- company_user = CompanyUser.find_by(company_id: company_id, id: company_user_id)
- user_setting = company_user.settings['pipeline_view_settings'] || {}
- CompanyUserSetting.create(
- company_id: company_id,
- company_user_id: company_user_id,
- setting_id: setting.id,
- setting_value: user_setting.to_json
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement