Sha256: 90afb8db3d2c9837d0bb0d9e20290835a346d0c9e92d6829aa6cc5165d567fb5

Contents?: true

Size: 995 Bytes

Versions: 63

Compression:

Stored size: 995 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"]
budgets = [15000, 25000, 10000, 20000, 30000, 12000, 13000]

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}", marketing_budget: budgets.sample, singer_id: singer_id
end

Version data entries

63 entries across 21 versions & 1 rubygems

Version Path
activerecord-spanner-adapter-1.6.3 examples/snippets/optimistic-locking/db/seeds.rb
activerecord-spanner-adapter-1.6.3 examples/snippets/read-write-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.3 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.6.2 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.6.2 examples/snippets/read-write-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.2 examples/snippets/optimistic-locking/db/seeds.rb
activerecord-spanner-adapter-1.6.1 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.6.1 examples/snippets/read-write-transactions/db/seeds.rb
activerecord-spanner-adapter-1.6.1 examples/snippets/optimistic-locking/db/seeds.rb
activerecord-spanner-adapter-1.6.0 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.6.0 examples/snippets/optimistic-locking/db/seeds.rb
activerecord-spanner-adapter-1.6.0 examples/snippets/read-write-transactions/db/seeds.rb
activerecord-spanner-adapter-1.5.1 examples/snippets/optimistic-locking/db/seeds.rb
activerecord-spanner-adapter-1.5.1 examples/snippets/read-write-transactions/db/seeds.rb
activerecord-spanner-adapter-1.5.1 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.5.0 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.5.0 examples/snippets/optimistic-locking/db/seeds.rb
activerecord-spanner-adapter-1.5.0 examples/snippets/read-write-transactions/db/seeds.rb
activerecord-spanner-adapter-1.4.4 examples/snippets/mutations/db/seeds.rb
activerecord-spanner-adapter-1.4.4 examples/snippets/optimistic-locking/db/seeds.rb