module Blog
  class Admin::ApplicationController < ActionController::Base
    layout "blog/admin"

    force_ssl if: :ssl_configured?
    protect_from_forgery with: :exception

    def ssl_configured?
      !Rails.env.development?
    end
  end
end

module Blog
  class Admin::ApplicationController < ActionController::Base
    layout "blog/admin"

    force_ssl if: :ssl_configured?
    protect_from_forgery with: :exception

    def ssl_configured?
      Rails.env.production?
    end
  end
end

Check for SSL a different way
Check for SSL a different way

Check for SSL by checking if in production, since this method needs to
work in testing environment as well.
