class Planter::Generators::SeederGenerator
Rails generator that creates one or more Planter seeder files.
By default, generated seeders include a TODO comment and an empty seed method so they do not raise until a seeding method is chosen. Pass +–seeding-method=csv+, +–seeding-method=data-array+, or +–seeding-method=custom+ to generate a seeder for a specific style. The csv method also creates a CSV seed file with headers pulled from the table being seeded.
Constants
- SEEDING_METHODS
-
Generator-supported seeding method templates.
@return [Array<Symbol>]
Public Instance Methods
Source
# File lib/generators/planter/seeder_generator.rb, line 32 def generate_seeders (seeder == "ALL") ? tables.each { |t| generate(t) } : generate(seeder) end
Generate the requested seeder, or generate a seeder for every table when the argument is ALL.