Sha256: 5a05c464324da16b05b6258fd27d036f656699564711892a7e796504f44446f0
Contents?: true
Size: 636 Bytes
Versions: 1
Compression:
Stored size: 636 Bytes
Contents
module Kangaroo module Model module DataImport def import_all records, options = {} fields = changed_fields_in records datas = map_fields_in records, fields fields << '.id' import_data fields, datas, options end protected def changed_fields_in records records.sum([]) do |record| record.changed end.uniq end def map_fields_in records, fields records.map do |record| fields.map do |field| record.read_attribute field end + [record.id] end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
kangaroo-0.1.0.alpha1 | lib/kangaroo/model/data_import.rb |