This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Bulk merge a bunch of records | |
# | |
# we expect most of the records to import to represent updates | |
# so this method tries to be efficent with database queries | |
# by using a single query to find any existing records matching the key_attributes | |
# updating those records and finally inserting each remaining record | |
# | |
# It DOEST NOT use a transaction or lock. callers responsibilty to | |
# add that if desired | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ActiveRecord::Base | |
# Bulk merge a bunch of records | |
# | |
# we expect most of the records to import to represent updates | |
# so this method tries to be efficent with database queries | |
# by using a single query to find any existing records matching the key_attributes | |
# updating those records and finally inserting each remaining record | |
# | |
# It DOEST NOT use a transaction or lock. callers responsibilty to | |
# add that if desired |
NewerOlder