Module: Alchemy::Page::PageScopes::ClassMethods
- Defined in:
- app/models/alchemy/page/page_scopes.rb
Instance Method Summary collapse
-
#not_public(time = Time.current) ⇒ Object
All pages that do not have any public version.
- #ransackable_scopes(_auth_object) ⇒ Object
Instance Method Details
#not_public(time = Time.current) ⇒ Object
All pages that do not have any public version
123 124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'app/models/alchemy/page/page_scopes.rb', line 123 def not_public(time = Time.current) where <<~SQL alchemy_pages.id NOT IN ( SELECT alchemy_page_versions.page_id FROM alchemy_page_versions WHERE alchemy_page_versions.public_on <= '#{connection.quoted_date(time)}' AND ( alchemy_page_versions.public_until IS NULL OR alchemy_page_versions.public_until >= '#{connection.quoted_date(time)}' ) ) SQL end |
#ransackable_scopes(_auth_object) ⇒ Object
137 138 139 |
# File 'app/models/alchemy/page/page_scopes.rb', line 137 def ransackable_scopes(_auth_object) [:published, :not_public, :restricted, :contentpages, :from_current_site, :searchables, :layoutpages, :by_page_layout] end |