Skip to content

Instantly share code, notes, and snippets.

@umar-siddiqui
Last active March 16, 2018 13:51
Show Gist options
  • Save umar-siddiqui/2a5f10bce47c0e37b7d2fcbef3bf1b65 to your computer and use it in GitHub Desktop.
Save umar-siddiqui/2a5f10bce47c0e37b7d2fcbef3bf1b65 to your computer and use it in GitHub Desktop.
create_sm.rb
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