I have a custom rake task
namespace :abc do
desc "seeds abc to a database" do
task seed_abc: :environment do
Tenant.find_each do |tenant|
puts "Running task for tenant#{tenant.name}"
Dir[File.join(Rails.root, 'db', 'seeds', '*.rb')].sort.each do |filename|
p "Seeding #{filename}"
load(filename) if File.exist?(filename)
end
end
end
end
when i run rake task its only seeded in default tenant, but while seeding i can see
Running task for tenant abc
"Seeding /path...../path/filename.rb"
"Seeding /path...../path/filename.rb"
Running task for tenant xyz
"Seeding /path...../path/filename.rb"
"Seeding /path...../path/filename.rb"
Running task for tenant 123
"Seeding /path...../path/filename.rb"
"Seeding /path...../path/filename.rb"
But when i check in console, its only seeded for default tenant, How do i seed for all the tenannts ?