Sha256: 64cb8180643616ef51a621a3d03696ddfde8b7f26e0e461cc8b17042203fd5e1

Contents?: true

Size: 274 Bytes

Versions: 2

Compression:

Stored size: 274 Bytes

Contents

module Chive
  module ApplicationHelper
    def article_list limit: 10, partial: 'chive/articles/list'
      Article.where('published_at <= ? AND (expired_at >= ? OR expired_at IS NULL)', DateTime.now, DateTime.now).order(published_at: :desc).limit(limit)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chive-0.0.2 app/helpers/chive/application_helper.rb
chive-0.0.1 app/helpers/chive/application_helper.rb