Module: Plus2Seeder
- Defined in:
- lib/plus2_seeder/seeder/spreadsheet.rb,
lib/plus2_seeder/version.rb,
lib/plus2_seeder/conductor.rb,
lib/plus2_seeder/seeder/base.rb
Overview
Superclass to be used for seeders that import data from a spreadsheet. The subclass needs to specify the source file, sheet, and column names. The subclass can optionally implement a pre_process and can_import? method.
e.g.
class PersonSeeder < SpreadsheetSeeder
source 'people.xls'
sheet 'People'
columns %w(name email phone)
end
PersonSeeder.new.seed
Will create instances of Person from the data in the People sheet of db/seeds/people.xls.
Defined Under Namespace
Modules: Seeder Classes: Conductor
Constant Summary collapse
- VERSION =
"0.0.6"