app/models/alchemy/page/page_scopes.rb in alchemy_cms-7.0.0.pre.a vs app/models/alchemy/page/page_scopes.rb in alchemy_cms-7.0.0.pre.b
- old
+ new
@@ -47,21 +47,21 @@
# All public pages
#
scope :published,
-> {
- joins(:language, :versions).
- merge(Language.published).
- merge(PageVersion.public_on(Time.current))
+ joins(:language, :versions)
+ .merge(Language.published)
+ .merge(PageVersion.public_on(Time.current))
}
# All pages that are a published language root
#
scope :public_language_roots,
-> {
published.language_roots.where(
- language_code: Language.published.pluck(:language_code),
+ language_code: Language.published.pluck(:language_code)
)
}
# Last 5 pages that where recently edited by given user
#
@@ -96,10 +96,10 @@
# All pages from +Alchemy::Site.current+
#
scope :from_current_site,
-> {
- where(Language.table_name => { site_id: Site.current || Site.default }).joins(:language)
+ where(Language.table_name => {site_id: Site.current || Site.default}).joins(:language)
}
# All pages for xml sitemap
#
scope :sitemap, -> { from_current_site.published.contentpages.where(sitemap: true) }