Sha256: 23a7ee59c86e18ba9be125f25117bab01b7d61c71fea8d39f74e855b3a0a30f3
Contents?: true
Size: 310 Bytes
Versions: 36
Compression:
Stored size: 310 Bytes
Contents
module WithGeneratedCode extend ActiveSupport::Concern included do validates_uniqueness_of :code defaults do self.code ||= self.class.generate_code end required :code_size end class_methods do def generate_code SecureRandom.urlsafe_base64 code_size end end end
Version data entries
36 entries across 36 versions & 1 rubygems