Sha256: 4592acc60498f8db282513fff5650cacc4f9fc35d115a6d3ed6166c617525a48

Contents?: true

Size: 677 Bytes

Versions: 27

Compression:

Stored size: 677 Bytes

Contents

module Enjoy
  module Models
    module ActiveRecord
      module News
        extend ActiveSupport::Concern
        included do
          unless Enjoy.config.news_image_styles.nil?
            has_attached_file :image, styles: Enjoy.config.news_image_styles
          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) }

          if Enjoy.config.localize
            translates :name, :excerpt, :content
          end
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
enjoy_cms-0.3.7.4 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.7.3 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.7.2 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.7.1 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.7 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.6.2 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.6.1 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.6 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.5 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.4 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.3 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.2.1 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.2 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.1.2 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.1.1 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.1 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.0.4 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.0.3 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.3.0.2 lib/enjoy/models/active_record/news.rb
enjoy_cms-0.2.1 lib/enjoy/models/active_record/news.rb