Sha256: d9b00e569481f09e50f426094e5ca8aaae9376e24e400787868d569856d1e0b8
Contents?: true
Size: 402 Bytes
Versions: 6
Compression:
Stored size: 402 Bytes
Contents
module NinjaModel class Base class_attribute :primary_key self.primary_key = :id undef_method(:id) if method_defined?(:id) end module Identity def to_model self end def to_param send(self.class.primary_key).to_s if persisted? end def to_key key = nil key = send(self.class.primary_key) if persisted? [key] if key end end end
Version data entries
6 entries across 6 versions & 1 rubygems