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 (
| name | age | message | |
|---|---|---|---|
| |
.DS_Store | Thu Jan 22 03:21:15 -0800 2009 | |
| |
README | Thu Jan 22 03:21:15 -0800 2009 | |
| |
Rakefile | Thu Jan 22 03:21:15 -0800 2009 | |
| |
init.rb | Thu Jan 22 03:21:15 -0800 2009 | |
| |
install.rb | Thu Jan 22 03:21:15 -0800 2009 | |
| |
lib/ | Thu Jan 22 03:21:15 -0800 2009 | |
| |
tasks/ | Thu Jan 22 03:21:15 -0800 2009 | |
| |
test/ | Thu Jan 22 03:21:15 -0800 2009 | |
| |
uninstall.rb | Thu Jan 22 03:21:15 -0800 2009 |
README
ActsAsStarred
=============
Dead simple starring of items - like GMail
Usage
=====
class YourModel < ActiveRecord::Base
acts_as_starred
end
This gets you:
YourModel#star!
YourModel#unstar!
YourModel#starred_by?(user/user_id)
YourModel#starrings
That's all there is to it.
Assumptions
===========
It assumes that you are using this in conjunction with something like the userstamp plugin
which assigns the current logged in user to created_by fields.
DB Structure
============
Need to add migration generator, but for now just copy this to a migration and
add any extra required fields
class CreateStarrings < ActiveRecord::Migration
def self.up
create_table :starrings do |t|
t.column :created_by, :integer
t.column :created_on, :datetime
t.column :item_id, :integer
t.column :item_type, :string
end
end
def self.down
drop_table :starrings
end
end
Testing
=======
The tests use RSpec, so this needs to be installed in your rails app







