public
Description: Tiny plugin to mark any rails model instance as an abuse or site's community guideline violation.
Homepage:
Clone URL: git://github.com/linkingpaths/acts_as_abusable.git
Click here to lend your support to: acts_as_abusable and make a donation at www.pledgie.com !
linkingpaths (author)
Thu Oct 16 04:43:12 -0700 2008
commit  b14f0b33a0b7e265a253fc78500d29a9ec4f0383
tree    79651f09db537e1f22b6a79eab77c7bbd2ace237
parent  426008a97dea93ad7c3cf71ad883029eaba99789
README.markdown

acts_as_abusable

Tiny plugin to mark any rails model instance as an abuse or site's community guideline violation.

Installation

  • Traditionally
script/plugin install git://github.com/linkingpaths/acts_as_abusable.git
  • Gemplugin:

If you prefer the new "gemplugin" management system just insert the dependency on environment.rb:

config.gem "linkingpaths-acts_as_abusable", :lib => "acts_as_abusable"
... and install it:
rake gems:install

  • Finally use the builtin generator for the needed migration:
script/generate acts_as_abusable_migration
rake db:migrate

Example

class Photo < ActiveRecord::Base
  acts_as_abusable
end

This gives you:

# All reported abuses
penthouse_sweetie_photo.reported_abuses

# Positive abuses
penthouse_sweetie_photo.reported_abuses.confirmed

# Still not evaluated abuses
penthouse_sweetie_photo.reported_abuses.pending

# Confirmed. This is inter....erhm... and abuse.
penthouse_sweetie_photo.is_an_abuse?

And a new ´Abuse´ model:

abuse.confirmed?
abuse.confirm!

# URL used as base for 
abuse.referer

# Resource that supposely is an abuse
abuse.resource

Copyright (c) 2008 Linking Paths, released under the MIT license