Sha256: 240b5e624148a7cb371f3cfc3bee74cfe74b73baa9dd79b8fb89baa7dbd46d01
Contents?: true
Size: 867 Bytes
Versions: 10
Compression:
Stored size: 867 Bytes
Contents
module RocketCMS module Models module ActiveRecord module News extend ActiveSupport::Concern included do if !RocketCMS.config.news_image_styles.nil? if RocketCMS.shrine? include NewsUploader.attachment(:image) elsif RocketCMS.paperclip? has_attached_file :image, styles: RocketCMS.config.news_image_styles end end has_paper_trail if respond_to?(:has_paper_trail) validates_lengths_from_database only: [:name, :title, :content, :excerpt, :h1, :keywords, :robots, :og_title] scope :after_now, -> { where("time < ?", Time.now) } scope :by_date, -> { order(time: :desc) } if RocketCMS.config.localize translates :name, :excerpt, :content end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems