Sha256: 3dcbc92c7ea57f9c7205c3f7c35e22fa297db4b5c16470b32e3f8775de81ff07
Contents?: true
Size: 821 Bytes
Versions: 15
Compression:
Stored size: 821 Bytes
Contents
module RocketCMS module Models module ActiveRecord module News extend ActiveSupport::Concern included do extend FriendlyId unless RocketCMS.configuration.news_image_styles.nil? has_attached_file :image, styles: RocketCMS.configuration.news_image_styles validates_attachment_content_type :image, content_type: %w(image/gif image/jpeg image/jpg image/png), if: :image? end friendly_id :report_slug, use: [:slugged, :finders] 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) } end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems