Sha256: 3e654d42e09cd8a9ccaa9229c2017762943704b08059bcaa770903ac260ad423
Contents?: true
Size: 470 Bytes
Versions: 4
Compression:
Stored size: 470 Bytes
Contents
# frozen_string_literal: true 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
4 entries across 4 versions & 1 rubygems