Sha256: e3a604165f63ad6627b51cbb146d3a8f2ff8044c686e1f966bd19541875f1493
Contents?: true
Size: 484 Bytes
Versions: 8
Compression:
Stored size: 484 Bytes
Contents
# frozen_string_literal: true require 'securerandom' class CustomPrimaryKeyRecord < ActiveRecord::Base self.primary_key = :uuid has_paper_trail versions: { 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
8 entries across 8 versions & 1 rubygems