public
Rubygem
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 !
name age message
file MIT-LICENSE Loading commit data...
file README.markdown Thu Oct 16 08:46:04 -0700 2008 Cleaning a few files not used. [Aitor García]
file Rakefile Wed Apr 30 11:20:21 -0700 2008 Massive initial load git-svn-id: https://svn.l... [Aitor García Rey]
file acts_as_abusable.gemspec Thu Oct 16 08:46:04 -0700 2008 Cleaning a few files not used. [Aitor García]
directory generators/ Wed Apr 30 11:20:21 -0700 2008 Massive initial load git-svn-id: https://svn.l... [Aitor García Rey]
file init.rb
directory lib/
directory tasks/
directory test/

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 abuse reports about this photo 
penthouse_sweetie_photo.reported_abuses

# Positive abuses
penthouse_sweetie_photo.reported_abuses.confirmed

# Still not evaluated abuse reports
penthouse_sweetie_photo.reported_abuses.pending

# Check if this photo has been positively marked as an abuse.
penthouse_sweetie_photo.is_an_abuse?

And a new ´Abuse´ model:

abuse.confirmed?
abuse.confirm!

# URL used as base for the abuse report
abuse.referer

# Resource that is linked to the abuse report
abuse.resource

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