app/models/alchemy/page.rb in alchemy_cms-2.1.beta5 vs app/models/alchemy/page.rb in alchemy_cms-2.1.beta6
- old
+ new
@@ -41,18 +41,18 @@
scope :visible, where(:visible => true)
scope :published, where(:public => true)
scope :accessable, where(:restricted => false)
scope :restricted, where(:restricted => true)
scope :public_language_roots, lambda {
- where(:language_root => true).where("language_code IN ('#{Language.all_codes_for_published.join('\',\'')}')").where(:public => true)
+ where(:language_root => true).where("`alchemy_pages`.`language_code` IN ('#{Language.all_codes_for_published.join('\',\'')}')").where(:public => true)
}
- scope :all_last_edited_from, lambda { |user| where(:updater_id => user.id).order('updated_at DESC').limit(5) }
+ scope :all_last_edited_from, lambda { |user| where(:updater_id => user.id).order('`alchemy_pages`.`updated_at` DESC').limit(5) }
# Returns all pages that have the given language_id
scope :with_language, lambda { |language_id| where(:language_id => language_id) }
# Returns all pages that are not locked and public.
# Used for flushing all page caches at once.
- scope :flushables, public.not_locked
- scope :contentpages, where("pages.layoutpage = 0 AND pages.parent_id IS NOT NULL")
+ scope :contentpages, where("`alchemy_pages`.`layoutpage` = 0 AND `alchemy_pages`.`parent_id` IS NOT NULL")
+ scope :flushables, not_locked.published.contentpages
# Finds selected elements from page.
#
# Options are:
#