Class: Drudgery::Loaders::ActiveRecordLoader
- Inherits:
-
Object
- Object
- Drudgery::Loaders::ActiveRecordLoader
- Defined in:
- lib/drudgery/loaders/active_record_loader.rb
Instance Method Summary collapse
-
#initialize(model) ⇒ ActiveRecordLoader
constructor
A new instance of ActiveRecordLoader.
- #load(records) ⇒ Object
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 |