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

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