Sha256: 47a3d0f19dbad58ae29be131c0570ae2ed7fd88642df23eceecaf79e66edcf9d

Contents?: true

Size: 901 Bytes

Versions: 43

Compression:

Stored size: 901 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"
require_relative "../models/album"

first_names = ["Pete", "Alice", "John", "Ethel", "Trudy", "Naomi", "Wendy", "Ruben", "Thomas", "Elly"]
last_names = ["Wendelson", "Allison", "Peterson", "Johnson", "Henderson", "Ericsson", "Aronson", "Tennet", "Courtou"]

adjectives = ["daily", "happy", "blue", "generous", "cooked", "bad", "open"]
nouns = ["windows", "potatoes", "bank", "street", "tree", "glass", "bottle"]

5.times do
  Singer.create first_name: first_names.sample, last_name: last_names.sample
end

20.times do
  singer_id = Singer.all.sample.id
  Album.create title: "#{adjectives.sample} #{nouns.sample}", singer_id: singer_id
end

Version data entries

43 entries across 22 versions & 1 rubygems

Version Path
activerecord-spanner-adapter-1.8.0 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.8.0 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.6.3 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.3 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.6.2 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.6.2 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.1 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.6.1 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.0 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.0 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.5.1 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.5.1 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.5.0 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.5.0 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.4.4 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.4.4 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.4.3 examples/snippets/read-only-transactions/db/seeds.rb
activerecord-spanner-adapter-1.4.3 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.4.2 examples/snippets/stale-reads/db/seeds.rb
activerecord-spanner-adapter-1.4.2 examples/snippets/read-only-transactions/db/seeds.rb