Sha256: f70853a5dfc7985357bc56a74e75ec948d3d124b45323f41fca7bdb3371adf50
Contents?: true
Size: 842 Bytes
Versions: 96
Compression:
Stored size: 842 Bytes
Contents
module RocketCMS module Models module Mongoid module News extend ActiveSupport::Concern unless RocketCMS.config.news_image_styles.nil? include ::Mongoid::Paperclip end included do field :time, type: Time index({enabled: 1, time: 1}) unless RocketCMS.config.news_image_styles.nil? has_mongoid_attached_file :image, styles: RocketCMS.config.news_image_styles end field :name, type: String, localize: RocketCMS.config.localize field :excerpt, type: String, localize: RocketCMS.config.localize field :content, type: String, localize: RocketCMS.config.localize scope :after_now, -> { where(:time.lt => Time.now) } scope :by_date, -> { desc(:time) } end end end end end
Version data entries
96 entries across 96 versions & 1 rubygems