Sha256: 0574b476f16e8b2fa567bacedf97ab26d2534d16acba75b3bcf6881733f056f2
Contents?: true
Size: 718 Bytes
Versions: 22
Compression:
Stored size: 718 Bytes
Contents
# Copyright 2021 Google LLC # # Use of this source code is governed by an MIT-style # license that can be found in the LICENSE file or at # https://opensource.org/licenses/MIT. require_relative "../../config/environment.rb" require_relative "../models/singer" first_names = %w[Pete Alice John Ethel Trudy Naomi Wendy Ruben Thomas Elly] last_names = %w[Wendelson Allison Peterson Johnson Henderson Ericsson Aronson Tennet Courtou] # This ensures all the records are inserted using one read/write transaction that will use mutations instead of DML. ActiveRecord::Base.transaction isolation: :buffered_mutations do 10.times do Singer.create first_name: first_names.sample, last_name: last_names.sample end end
Version data entries
22 entries across 22 versions & 1 rubygems