From 5a8ff3939c2af91590ff04387bcd535777b75b4d Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Sat, 10 Oct 2015 15:45:10 +0200 Subject: [PATCH] Removed Package.reload_classes, is not working on inheritance. --- app/models/package.rb | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/app/models/package.rb b/app/models/package.rb index 00cde4e6f..0c0c4382d 100644 --- a/app/models/package.rb +++ b/app/models/package.rb @@ -240,9 +240,6 @@ class Package < ApplicationModel record.state = 'installed' record.save - # reload new files - Package.reload_classes - # up migrations Package::Migration.migrate( meta[:name] ) @@ -294,11 +291,6 @@ class Package < ApplicationModel # prebuild assets - # reload new files (only if we are in uninstall modus) - if !data[:migration_not_down] - Package.reload_classes - end - # delete package record = Package.find_by( name: meta[:name], @@ -309,24 +301,6 @@ class Package < ApplicationModel true end - # reload .rb files in case they have changed - def self.reload_classes - %w(app lib).each {|dir| - Dir.glob( Rails.root.join( dir + '/**/*') ).each {|entry| - - next if entry !~ /\.rb$/ - - begin - load entry - rescue => e - logger.error "TRIED TO RELOAD '#{entry}'" - logger.error 'ERROR: ' + e.inspect - logger.error 'Traceback: ' + e.backtrace.inspect - end - } - } - end - def self._parse(xml) logger.debug xml.inspect begin @@ -497,8 +471,6 @@ class Package < ApplicationModel Package::Migration.create( name: package.underscore, version: version ) end - # reload new files - Package.reload_classes } end end