Sha256: 36c2343ebfc4e8c04b842a091d1caf81b90f7548b0882b5220e83895c6ad1b30
Contents?: true
Size: 408 Bytes
Versions: 20
Compression:
Stored size: 408 Bytes
Contents
module Superstore module AttributeMethods module PrimaryKey extend ActiveSupport::Concern module ClassMethods def primary_key 'id' 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
20 entries across 20 versions & 1 rubygems