Class: Napa::ActiveRecordSeeder
- Inherits:
-
Object
- Object
- Napa::ActiveRecordSeeder
- Defined in:
- lib/napa/active_record_extensions/seeder.rb
Instance Method Summary collapse
-
#initialize(seed_file) ⇒ ActiveRecordSeeder
constructor
A new instance of ActiveRecordSeeder.
- #load_seed ⇒ Object
Constructor Details
#initialize(seed_file) ⇒ ActiveRecordSeeder
Returns a new instance of ActiveRecordSeeder.
4 5 6 |
# File 'lib/napa/active_record_extensions/seeder.rb', line 4 def initialize(seed_file) @seed_file = seed_file end |
Instance Method Details
#load_seed ⇒ Object
8 9 10 11 |
# File 'lib/napa/active_record_extensions/seeder.rb', line 8 def load_seed raise "Seed file '#{@seed_file}' does not exist" unless File.file?(@seed_file) load @seed_file end |