Sha256: 07c66cf4a4d3f7d1f1b121fb1fdfce6733bf0914c59652fdb4f5d2e97a434152
Contents?: true
Size: 801 Bytes
Versions: 8
Compression:
Stored size: 801 Bytes
Contents
module Seoable extend ActiveSupport::Concern LOCALIZED_FIELDS = [:h1, :title, :keywords, :description, :og_title] FIELDS = LOCALIZED_FIELDS + [:og_image, :robots] if Seo.table_exists? included do has_one :seo, as: :seoable, autosave: true accepts_nested_attributes_for :seo delegate *FIELDS, to: :seo delegate *(FIELDS.map {|f| "#{f}=".to_sym }), to: :seo alias seo_without_build seo def seo seo_without_build || build_seo end if RocketCMS.config.localize delegate *(LOCALIZED_FIELDS.map {|f| "#{f}_translations".to_sym }), to: :seo delegate *(LOCALIZED_FIELDS.map {|f| "#{f}_translations=".to_sym }), to: :seo end end include RocketCMS::SeoHelpers else include RocketCMS::Models::Seo end end
Version data entries
8 entries across 8 versions & 1 rubygems