Class: Railsless::ActiveRecord::SeedLoader
- Inherits:
-
Object
- Object
- Railsless::ActiveRecord::SeedLoader
- Defined in:
- lib/railsless/active_record/seed_loader.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ SeedLoader
constructor
A new instance of SeedLoader.
- #load_seed ⇒ Object
Constructor Details
#initialize(path) ⇒ SeedLoader
Returns a new instance of SeedLoader.
5 6 7 |
# File 'lib/railsless/active_record/seed_loader.rb', line 5 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/railsless/active_record/seed_loader.rb', line 4 def path @path end |
Instance Method Details
#load_seed ⇒ Object
9 10 11 |
# File 'lib/railsless/active_record/seed_loader.rb', line 9 def load_seed Kernel.load(path) if path && File.exist?(path) end |