Sha256: 1fd2028b6a5dd414cf93653d528180315d01a84e00732a30dd362aaa6eb1528d
Contents?: true
Size: 439 Bytes
Versions: 9
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
9 entries across 9 versions & 1 rubygems