Sha256: 6a18c3b0f33937dd08db970a8ee688a9ee03277e71155d8e8dde0d26b2fde5b2

Contents?: true

Size: 491 Bytes

Versions: 1

Compression:

Stored size: 491 Bytes

Contents

ActiveAdmin.register Post do
  scope :all, :default => true

  scope :drafts do |posts|
    posts.where(["published_at IS NULL"])
  end

  scope :scheduled do |posts|
    posts.where(["posts.published_at IS NOT NULL AND posts.published_at > ?", Time.now.utc])
  end

  scope :published do |posts|
    posts.where(["posts.published_at IS NOT NULL AND posts.published_at < ?", Time.now.utc])
  end

  scope :my_posts do |posts|
    posts.where(:author_id => current_admin_user.id)
  end


end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-axlsx-2.1.2 spec/rails/rails-3.2.9/app/admin/posts.rb