I need to organize my seeds.rb file, so I created a namespace where I will add my classes ex:
module Seeds
class Apple
def self.run
puts 'teste'
end
end
end
Seeds::Apple.run
This works perfectly, but I need to separate my classes into separate files similar to the structure below:
db
seeds
Apple.rb
seeds.rb
and no seeds.rb:
require 'db/seeds/Apple'
Seeds::Apple.run
and it returns an error that can not load the file, what could it be?