Sha256: 1cb926fa80ecc8265cd98a9111bf140f1e52dae66859b55dffaee72cb722a10f
Contents?: true
Size: 425 Bytes
Versions: 34
Compression:
Stored size: 425 Bytes
Contents
module CouchPotato module MagicTimestamps #:nodoc: def self.included(base) base.instance_eval do property :created_at, :type => Time property :updated_at, :type => Time before_create lambda {|model| model.created_at = Time.now; model.created_at_not_changed} before_save lambda {|model| model.updated_at = Time.now; model.updated_at_not_changed} end end end end
Version data entries
34 entries across 34 versions & 4 rubygems