mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 17:31:12 +00:00
Run through association
This commit is contained in:
parent
22d2c1b60a
commit
8d660212aa
|
@ -68,7 +68,7 @@ class Form::Import
|
||||||
|
|
||||||
ApplicationRecord.transaction do
|
ApplicationRecord.transaction do
|
||||||
@bulk_import = current_account.bulk_imports.create(type: type, overwrite: overwrite || false, state: :unconfirmed, original_filename: data.original_filename, likely_mismatched: likely_mismatched?)
|
@bulk_import = current_account.bulk_imports.create(type: type, overwrite: overwrite || false, state: :unconfirmed, original_filename: data.original_filename, likely_mismatched: likely_mismatched?)
|
||||||
nb_items = BulkImportRow.insert_all(parsed_rows.map { |row| { bulk_import_id: bulk_import.id, data: row } }, record_timestamps: true).length
|
nb_items = @bulk_import.rows.insert_all(parsed_rows.map { |row| { data: row } }, record_timestamps: true).length
|
||||||
@bulk_import.update(total_items: nb_items)
|
@bulk_import.update(total_items: nb_items)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user