Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
scope = ENV['only'].blank? ? 'all' : ENV['only']
files = %w[
setup_mpc_category_and_events
create_users_roles
]
scopes = []
if scope == 'all'
scopes = files
elsif scope.include?(',')
scopes = scope.split(',')
else
scopes << scope
end
env_path = Rails.env.production? ? 'production' : 'others'
puts "\t\t\t---===[ Seeding start ]===---"
scopes.each do |file|
puts ''
puts "\t\t\t---===[ Seeding file: #{file}... ]===---"
puts ''
load(Rails.root.join('db', 'seeds', 'environments', env_path, "#{file}.rb"))
end
puts ''
puts "\t\t\t---===[ Seeding stop ]===---"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment