Merge pull request #223 from opf/feature/rails3_remove_preload_circular_dependencies

Removed function to preload circular dependencies
pull/227/head
Philipp Tessenow 11 years ago
commit 08a7cf11ae
  1. 1
      app/controllers/application_controller.rb
  2. 2
      app/models/principal.rb
  3. 2
      app/models/project.rb
  4. 1
      app/models/user.rb
  5. 9
      config/application.rb
  6. 2
      lib/redmine.rb

@ -15,7 +15,6 @@ require 'cgi'
class ApplicationController < ActionController::Base
# ensure the OpenProject models are required in the right order (as they have circular dependencies)
OpenProject.preload_circular_dependencies
class_attribute :_model_object
class_attribute :_model_scope

@ -10,6 +10,8 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
require_dependency 'project'
class Principal < ActiveRecord::Base
extend Pagination::Model

@ -10,6 +10,8 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
require_dependency 'issue'
class Project < ActiveRecord::Base
include Redmine::SafeAttributes

@ -10,6 +10,7 @@
# See doc/COPYRIGHT.rdoc for more details.
#++
require_dependency 'principal'
require "digest/sha1"
class User < Principal

@ -87,13 +87,4 @@ module OpenProject
# initialize variable for register plugin tests
config.plugins_to_test_paths = []
end
def self.preload_circular_dependencies
# preload circular dependencies. this should be used to ensure the correct load
# order when loading core classes from plugins.
require_dependency 'issue'
require_dependency 'project'
require_dependency 'user'
require_dependency 'principal'
end
end

@ -369,5 +369,3 @@ Redmine::WikiFormatting.map do |format|
end
ActionView::Template.register_template_handler :rsb, Redmine::Views::ApiTemplateHandler
OpenProject.preload_circular_dependencies

Loading…
Cancel
Save