Class: Development::Seeder
- Inherits:
-
Object
- Object
- Development::Seeder
- Defined in:
- lib/templates/lib/development/seeder.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.load_seeds ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/templates/lib/development/seeder.rb', line 7 def self.load_seeds if Rails.env.development? new.load_seeds else raise "Development::Seeder can only be run in a development environment." end end |
Instance Method Details
#load_seeds ⇒ Object
15 16 17 18 19 |
# File 'lib/templates/lib/development/seeder.rb', line 15 def load_seeds # ["Ruby", "Ralph"].each do |name| # User.find_or_create_by!(name:) # end end |