No commit activity in last 3 years
No release in over 3 years
Acts as published beahviour for active record models.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Project Readme

Acts as published¶ ↑

Gives you a boolean reader/writer for a published_at (timestamp) column.

Installation¶ ↑

Add it to your Gemfile:

gem 'acts_as_published'

Install your bundle:

> bundle install

Usage¶ ↑

You need a published_at:timestamp column

In your model:

class Post < ActiveRecord::Base
  # acts as published
  include ActsAsPublished::ActiveRecord
  acts_as_published

  # ...
end

ActiveAdmin integration¶ ↑

ActiveAdmin.register Post do
  form do |f|
    f.inputs do
      f.input :title
      # ...
      f.input :published, :as => :boolean
      # ...
    end
  end

  index do
    column :title
    # ...
    acts_as_published_columns
    # ...
  end

  show do
    attributes_table do
      row :title
      # ...
      acts_as_published_rows
      # ...
    end
  end  
end if defined?(ActiveAdmin)

Scopes¶ ↑

You get following scopes:

Post.published
Post.unpublished