Class: Railsless::ActiveRecord::SeedLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/railsless/active_record/seed_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject

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_seedObject



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