This gem is derived from the acts_as_publishable plugin in bborn's communityengine
It allows an ActiveRecord model to move through publishing stages (draft, live, deleted, etc.).
This gem is not complete yet--I have used it successfully in a project, but incorporate at your own risk. If you do try it, feel free to file reports for any bugs you encounter.
-
Add the gem to your Gemfile:
gem 'acts_as_publishable'
-
Add the acts_as_publishable macro to your model, e.g.
class BlogPost < ActiveRecord::Base
acts_as_publishable(:draft, :live, :deleted) end
-
Generate a migration for the additional columns
rails g acts_as_publishable:migrate [model]
-
Migrate your database schema
rake db:migrate