Sha256: 217a65487515d695d55b59ee0152508c810e55cdb20944571566c62833748ea5
Contents?: true
Size: 730 Bytes
Versions: 51
Compression:
Stored size: 730 Bytes
Contents
module RocketCMS module Models module ActiveRecord module News extend ActiveSupport::Concern included do 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 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
51 entries across 51 versions & 2 rubygems