diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2019-03-09 01:15:17 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2019-03-20 13:28:18 +0100 |
commit | 2ea5c24085e39efb6c1bc6e7062bcc5f496d1fa6 (patch) | |
tree | 9a6448dca6dcd973957584686edf60961189ae01 /activemodel/test/models/track_back.rb | |
parent | c11d115fa3c58ec6bde5e9799673cee381d22d47 (diff) | |
download | rails-2ea5c24085e39efb6c1bc6e7062bcc5f496d1fa6.tar.gz rails-2ea5c24085e39efb6c1bc6e7062bcc5f496d1fa6.tar.bz2 rails-2ea5c24085e39efb6c1bc6e7062bcc5f496d1fa6.zip |
Bulk Insert: Reuse indexes for unique_by
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.
Diffstat (limited to 'activemodel/test/models/track_back.rb')
0 files changed, 0 insertions, 0 deletions