Class: Drudgery::Loaders::ActiveRecordLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/drudgery/loaders/active_record_loader.rb

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ ActiveRecordLoader

Returns a new instance of ActiveRecordLoader.



4
5
6
# File 'lib/drudgery/loaders/active_record_loader.rb', line 4

def initialize(model)
  @model = model
end

Instance Method Details

#load(records) ⇒ Object



8
9
10
11
12
# File 'lib/drudgery/loaders/active_record_loader.rb', line 8

def load(records)
  records.each do |record|
    @model.new(record).save(:validate => false)
  end
end