0
I need to organize my file Seeds.Rb, so I created a namespace where I will add my ex classes:
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 in Seeds.Rb:
require 'db/seeds/Apple'
Seeds::Apple.run
and it returns an error that fails to load the file, which could be?
Do you know this Gem? https://github.com/james2m/seedbank Does not solve your problem?
– Alex Takitani
Thank you, that will solve.
– Daniel
Okay, I’ll post as an answer.
– Alex Takitani