You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: page_scopes.rb
    path of file: ./repos/alchemy_cms/app/models/alchemy/page
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Alchemy
  # ActiveRecord scopes for Alchemy::Page
  #
  class Page < BaseRecord
    module PageScopes
      extend ActiveSupport::Concern

      included do
        # All pages of given page layout
        #
        scope :by_page_layout, ->(page_layout) { where(page_layout: page_layout) }

        # All language root pages
        #
        scope :language_roots, -> { where(language_root: true) }

        # All la
    
        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