Sha256: 8aa7fad7d9b7118d48fd4aaeacac6958561ccc9dfb968c546943a49b760b15cc

Contents?: true

Size: 594 Bytes

Versions: 4

Compression:

Stored size: 594 Bytes

Contents

# Copyright 2023 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.

class Singer < ActiveRecord::Base
  # Set the sequence name so the ActiveRecord provider knows that it should let the database generate the primary key
  # value and return it using a `THEN RETURN id` clause.
  self.sequence_name = :singer_sequence

  # `albums` is defined as INTERLEAVE IN PARENT `singers`.
  # The primary key of `albums` is (`singerid`, `albumid`).
  has_many :albums, foreign_key: :singerid
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
activerecord-spanner-adapter-1.6.3 examples/snippets/bit-reversed-sequence/models/singer.rb
activerecord-spanner-adapter-1.6.2 examples/snippets/bit-reversed-sequence/models/singer.rb
activerecord-spanner-adapter-1.6.1 examples/snippets/bit-reversed-sequence/models/singer.rb
activerecord-spanner-adapter-1.6.0 examples/snippets/bit-reversed-sequence/models/singer.rb