Sha256: dcf1eadba139ddad2fb0e673e19eaa66b0a2b536ea15c22ffecfd81223d5d567
Contents?: true
Size: 726 Bytes
Versions: 68
Compression:
Stored size: 726 Bytes
Contents
module RocketCMS module Models module ActiveRecord module News extend ActiveSupport::Concern included do unless RocketCMS.config.news_image_styles.nil? has_attached_file :image, styles: RocketCMS.config.news_image_styles 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
68 entries across 68 versions & 1 rubygems