Sha256: ca6678a60fd84c90a13371d0f0e9c93f5e478aaccb5466991309a7921d81516e

Contents?: true

Size: 782 Bytes

Versions: 1

Compression:

Stored size: 782 Bytes

Contents

module Hancock::Seo
  module Models
    module Mongoid
      module SitemapData
        extend ActiveSupport::Concern

        included do
          index({sitemap_data_field_id: 1, sitemap_data_field_type: 1}, {background: true})
          index({enabled: 1, sitemap_show: 1},                          {background: true})

          field :sitemap_show,        type: Boolean, default: true
          field :sitemap_lastmod,     type: DateTime
          field :sitemap_changefreq,  type: String,   default: 'daily'
          field :sitemap_priority,    type: Float

          scope :sitemap_show,    -> { where(sitemap_show: true) }
          scope :for_sitemap,     -> { sitemap_show }
          scope :show_in_sitemap, -> { sitemap_show }
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hancock_cms_seo-1.0.2 lib/hancock/seo/models/mongoid/sitemap_data.rb