Module: Publishable
- Defined in:
- lib/publishable.rb,
lib/publishable/railtie.rb,
lib/publishable/version.rb
Overview
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.
Defined Under Namespace
Modules: ClassMethods, VERSION Classes: Railtie
Class Method Summary collapse
-
.extended(base) ⇒ Object
Add our features to the base class.
Class Method Details
.extended(base) ⇒ Object
Add our features to the base class.
22 23 24 |
# File 'lib/publishable.rb', line 22 def self.extended(base) base.extend ClassMethods end |