Sha256: 72739817c8ee51bc2256dbda58b3c8cf381e5fbd0553c3fa66ffb193668a9bc7

Contents?: true

Size: 566 Bytes

Versions: 23

Compression:

Stored size: 566 Bytes

Contents

module Enjoy::SitemapDataField
  extend ActiveSupport::Concern
  FIELDS = [:sitemap_show, :sitemap_lastmod, :sitemap_changefreq, :sitemap_priority]

  included do
    has_one :sitemap_data, as: :sitemap_data_field, autosave: true, class_name: "Enjoy::SitemapData"
    accepts_nested_attributes_for :sitemap_data

    delegate *FIELDS, to: :sitemap_data
    delegate *(FIELDS.map {|f| "#{f}=".to_sym }), to: :sitemap_data

    alias sitemap_data_without_build sitemap_data
    def sitemap_data
      sitemap_data_without_build || build_sitemap_data
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

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