0.0
No commit activity in last 3 years
No release in over 3 years
Rapidly and arbitrarily timestamp ActiveRecord records
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.2.9
 Project Readme

fast_timestamp¶ ↑

Suggested Timestamp model¶ ↑

class Timestamp < ActiveRecord::Base
  index [:timestampable_id, :timestampable_type, :key]            # for cache-money only
  index :id                                                       # for cache-money only
  belongs_to :timestampable, :polymorphic => true
  validates_presence_of :key, :timestampable_id, :timestampable_type
  validates_uniqueness_of :key, :scope => [ :timestampable_id, :timestampable_type ]
end

Suggested Timestamp migration¶ ↑

create_table "timestamps", :force => true do |t|
  t.integer  "timestampable_id"
  t.string   "timestampable_type"
  t.string   "key"
  t.datetime "stamped_at"
  t.datetime "created_at"
  t.datetime "updated_at"
end

add_index "timestamps", ["timestampable_id", "timestampable_type", "key"], :name => "index_timestamps_on_t_id_and_t_type_and_key"
add_index "timestamps", ["timestampable_id", "timestampable_type"], :name => "index_timestamps_on_timestampable_id_and_timestampable_type"

Copyright © 2009 Seamus Abshere. See LICENSE for details.