lib/alchemy/page_layout.rb in alchemy_cms-4.0.6 vs lib/alchemy/page_layout.rb in alchemy_cms-4.1.0.beta
- old
+ new
@@ -136,11 +136,11 @@
end
# Returns true if one page already has the given layout
#
def page_with_layout_existing?(layout)
- Page.where(page_layout: layout, language_id: @language_id).pluck(:id).any?
+ Alchemy::Page.where(page_layout: layout, language_id: @language_id).pluck(:id).any?
end
# Returns true if given layout is available for current site.
#
# If no site layouts are defined it always returns true.
@@ -150,10 +150,11 @@
# # config/alchemy/site_layouts.yml
# - name: default_site
# page_layouts: [default_intro]
#
def available_on_site?(layout)
- Site.current.definition.blank? || Site.current.definition.fetch('page_layouts', []).include?(layout['name'])
+ Alchemy::Site.current.definition.blank? ||
+ Alchemy::Site.current.definition.fetch('page_layouts', []).include?(layout['name'])
end
# Reads the layout definitions from +config/alchemy/page_layouts.yml+.
#
def read_definitions_file