module Publishable

Allows a given boolean, date, or datetime column to indicate whether a model object is published. Boolean published column just is an on/off flag. Date/datetime column requires value of published column to be before “now” for the object to be published. Specify the column name via the :on option (defaults to :published) and make sure to create the column in your migrations.

Provides scopes for finding published and unpublished items, and (for date/datetime published columns) for returning recent or upcoming items.

@author Martin Linkhorst <m.linkhorst@gmail.com> @author David Daniell / тιηуηυмвєяѕ <info@tinynumbers.com> @author Andrew Janssen <andrew.janssen@sardiusgroup.com>

Public Class Methods

extended(base) click to toggle source

Add our features to the base class. @see ClassMethods#publishable @param [Object] base

# File lib/publishable.rb, line 22
def self.extended(base)
  base.extend ClassMethods
end