Sha256: 50f34a6f44e55dbc23488361413cfdda830f0ef8ee4211ee318a2512ebb1d354

Contents?: true

Size: 439 Bytes

Versions: 6

Compression:

Stored size: 439 Bytes

Contents

require "securerandom"

class CustomPrimaryKeyRecord < ActiveRecord::Base
  self.primary_key = :uuid

  has_paper_trail class_name: "CustomPrimaryKeyRecordVersion"

  # This default_scope is to test the case of the Version#item association
  # not returning the item due to unmatched default_scope on the model.
  default_scope { where(name: "custom_primary_key_record") }

  before_create do
    self.uuid ||= SecureRandom.uuid
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
paper_trail-7.1.0 spec/dummy_app/app/models/custom_primary_key_record.rb
paper_trail-7.0.3 test/dummy/app/models/custom_primary_key_record.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paper_trail-7.0.2/test/dummy/app/models/custom_primary_key_record.rb
paper_trail-7.0.2 test/dummy/app/models/custom_primary_key_record.rb
paper_trail-7.0.1 test/dummy/app/models/custom_primary_key_record.rb
paper_trail-7.0.0 test/dummy/app/models/custom_primary_key_record.rb