This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
README
ActsAsHittable
===============
This is a simple plugin to allow you to track any AR model. To use add the following line to your model:
class SomeModel < ActiveRecord::Base
acts_as_hittable
end
Migration Needed
class CreateHits < ActiveRecord::Migration
def self.up
create_table :hits do |t|
t.column :hittable_type, :string
t.column :hittable_id, :integer
t.timestamps
end
add_index :hits, [:hittable_type, :hittable_id]
end
def self.down
drop_table :hits
end
end
Example
=======
model.hit - creates a new tracking for your object
collection.hit - creates a new tracking for each object in collection
model.hit_count - number of hits on model
Copyright (c) 2008 Jake Dempsey, released under the MIT license








