From d36f62c3bc55d8211ea142fb89a970ac850f96a7 Mon Sep 17 00:00:00 2001 From: Volodymyr Partyka Date: Thu, 12 Nov 2020 00:42:43 +0200 Subject: [PATCH] updated for meta_tags --- app/controllers/spree/static_content_controller.rb | 1 + app/models/application_record.rb | 3 +++ app/models/spree/page.rb | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 app/models/application_record.rb diff --git a/app/controllers/spree/static_content_controller.rb b/app/controllers/spree/static_content_controller.rb index 7ef41b0e..1f23160b 100644 --- a/app/controllers/spree/static_content_controller.rb +++ b/app/controllers/spree/static_content_controller.rb @@ -5,6 +5,7 @@ class StaticContentController < StoreController def show @page = Spree::StaticPage.finder_scope.by_store(current_store).find_by!(slug: request.path) + @static_content = @page # needed to use meta tags end private diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 00000000..10a4cba8 --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ActiveRecord::Base + self.abstract_class = true +end diff --git a/app/models/spree/page.rb b/app/models/spree/page.rb index 976cf0c1..20f34d2b 100644 --- a/app/models/spree/page.rb +++ b/app/models/spree/page.rb @@ -1,4 +1,4 @@ -class Spree::Page < ActiveRecord::Base +class Spree::Page < ApplicationRecord default_scope { order(position: :asc) } has_and_belongs_to_many :stores, join_table: 'spree_pages_stores'