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: dashboard_controller.rb
    path of file: ./repos/alchemy_cms/app/controllers/alchemy/admin
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

require "net/http"
require "alchemy/version"

module Alchemy
  module Admin
    class DashboardController < Alchemy::Admin::BaseController
      authorize_resource class: :alchemy_admin_dashboard

      def index
        @last_edited_pages = Page.all_last_edited_from(current_alchemy_user)
        @all_locked_pages = Page.locked
        if Alchemy.user_class.respond_to?(:
    
      def get_alchemy_versions
        # first we try rubygems.org
        response = query_rubygems
        if response.code == "200"
          alchemy_versions = JSON.parse(response.body)
          alchemy_versions.collect { |h| h["number"] }.sort
        else
          # rubygems.org not available?
          # then we try github
          response = query_github
          if response.code == "200"
            alchemy_tags = JSON.parse(response.body)
            alchemy_tags.collect { |h| h["name"].tr("v", "") }.sort
          else
            # no luck at all?
            raise UpdateServiceUnavailable
          end