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

Version Path
rocket_cms-0.30.0 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.29.0 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.28.0 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.8 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.7 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.6 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.5 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.4 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.3 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.2 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.1 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.27.0 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.26.1 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.26.0 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.25.5 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.25.4 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.25.3 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.25.1 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.25.0 lib/rocket_cms/models/mongoid/news.rb
rocket_cms-0.24.0 lib/rocket_cms/models/mongoid/news.rb