Last active
March 16, 2018 13:51
-
-
Save umar-siddiqui/2a5f10bce47c0e37b7d2fcbef3bf1b65 to your computer and use it in GitHub Desktop.
create_sm.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Settings.client_databases.to_h.map{ |k,v| v }.uniq.each_with_index do |db, index| | |
puts "-------------------& DB - #{db} &-----------------\n\n" | |
Client.all.each do |client| | |
Mongoid::Multitenancy.current_tenant = client | |
puts " & Client - #{client.name} &\n\n" | |
UserRole.find_or_create_by!(name: 'Supplier Manager') | |
UserRole.find_or_create_by!(name: 'Project Admin') | |
UserRole.find_or_create_by!(name: 'Budget Admin') | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment