canvas-lms/config/initializers/stubs.rb

28 lines
1.2 KiB
Ruby

# frozen_string_literal: true
#
# Copyright (C) 2011 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas is free software: you can redistribute it and/or modify it under
# the terms of the GNU Affero General Public License as published by the Free
# Software Foundation, version 3 of the License.
#
# Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
# details.
#
# You should have received a copy of the GNU Affero General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
# stubs go at the bottom of the autoload path so that a plugin's version will
# be found first
#
# TODO: we need to migrate this to using "config.autoload_paths", maybe from
# application.rb? this is to conform to https://guides.rubyonrails.org/autoloading_and_reloading_constants.html
# which states "Please, do not mutate ActiveSupport::Dependencies.autoload_paths,
# the public interface to change autoload paths is config.autoload_paths."
ActiveSupport::Dependencies.autoload_paths.push(Rails.root.join("lib/stubs"))