Sha256: 7d69c09ce2a0bba0956dd601ca69fa54b77cffcb4d48fb3726ff3b429dbb63f2

Contents?: true

Size: 1.08 KB

Versions: 3

Compression:

Stored size: 1.08 KB

Contents

= 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

Copyright (c) 2009 Seamus Abshere. See LICENSE for details.

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fast_timestamp-0.0.4 README.rdoc
fast_timestamp-0.0.3 README.rdoc
fast_timestamp-0.0.2 README.rdoc