aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/insert_all_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Extract insert test case from #35686Kasper Timm Hansen2019-03-311-0/+14
|
* Bulk Insert: Reuse indexes for unique_byKasper Timm Hansen2019-03-201-3/+33
| | | | | | | | | | | I found `:unique_by` with `:columns` and `:where` inside it tough to grasp. The documentation only mentioned indexes and partial indexes. So why duplicate a model's indexes in an insert_all/upsert_all call when we can just look it up? This has the added benefit of raising if no index is found, such that people can't insert thousands of records without relying on an index of some form.
* Raise UnknownAttributeError when unknown column is passed to insert_all and ↵Josef Šimánek2019-03-161-0/+6
| | | | friends.
* Add some whitespace for readability.Kasper Timm Hansen2019-03-061-0/+12
|
* Fix test case name after file extractionKasper Timm Hansen2019-03-061-1/+1
| | | | | Although the old name had a certain persistence, this ain't the kind of file we're in now.
* Handle blank inserts like update_all; raise upfront.Kasper Timm Hansen2019-03-061-1/+1
|
* Add insert_all to ActiveRecord models (#35077)Bob Lail2019-03-051-0/+127
Adds a method to ActiveRecord allowing records to be inserted in bulk without instantiating ActiveRecord models. This method supports options for handling uniqueness violations by skipping duplicate records or overwriting them in an UPSERT operation. ActiveRecord already supports bulk-update and bulk-destroy actions that execute SQL UPDATE and DELETE commands directly. It also supports bulk-read actions through `pluck`. It makes sense for it also to support bulk-creation.