Sha256: 12331d2a0c1677fc2282648a7113d9280d3203b2f2b17ee532a8ae24fe1ea27d
Contents?: true
Size: 442 Bytes
Versions: 11
Compression:
Stored size: 442 Bytes
Contents
module Superstore module AttributeMethods module PrimaryKey extend ActiveSupport::Concern module ClassMethods PRIMARY_KEY = 'id' def primary_key PRIMARY_KEY end end def id @id ||= self.class._generate_key(self) end def id=(id) @id = id end def attributes super.update(self.class.primary_key => id) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems