Sha256: 41a43a467e69a3828da8ed633f9808508b36cb4c3d299630b5a781ba20ab3cfc
Contents?: true
Size: 502 Bytes
Versions: 15
Compression:
Stored size: 502 Bytes
Contents
module ActiveTools module ActiveRecord module RecordId extend ::ActiveSupport::Concern included do end module ClassMethods end def record_id "#{self.class.model_name.singular}_#{try(self.class.primary_key)||uniq_id}" end def uniq_id @_uniq_id ||= Base64.urlsafe_encode64(Time.now.send(:_dump))[0..-2] end end end module OnLoadActiveRecord include ActiveRecord::RecordId end end
Version data entries
15 entries across 15 versions & 1 rubygems