Sha256: 689a5529d50c04092bf3d348ff2692c7ac5d59616df2add706e98347b2e7ed1a
Contents?: true
Size: 448 Bytes
Versions: 5
Compression:
Stored size: 448 Bytes
Contents
require "securerandom" class CustomPrimaryKeyRecord < ActiveRecord::Base self.primary_key = :uuid has_paper_trail class_name: "CustomPrimaryKeyRecordVersion" # this unusual 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
5 entries across 5 versions & 2 rubygems