Sha256: db7a6c6994017a5943e0ece789fa7ec05a4c9ab475863347275fa629385646b8
Contents?: true
Size: 416 Bytes
Versions: 5
Compression:
Stored size: 416 Bytes
Contents
module CouchPotato module MagicTimestamps 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
5 entries across 5 versions & 2 rubygems