Removed Package.reload_classes, is not working on inheritance.

This commit is contained in:
Martin Edenhofer 2015-10-10 15:45:10 +02:00
parent 16232826cf
commit 5a8ff3939c

View file

@ -240,9 +240,6 @@ class Package < ApplicationModel
record.state = 'installed' record.state = 'installed'
record.save record.save
# reload new files
Package.reload_classes
# up migrations # up migrations
Package::Migration.migrate( meta[:name] ) Package::Migration.migrate( meta[:name] )
@ -294,11 +291,6 @@ class Package < ApplicationModel
# prebuild assets # prebuild assets
# reload new files (only if we are in uninstall modus)
if !data[:migration_not_down]
Package.reload_classes
end
# delete package # delete package
record = Package.find_by( record = Package.find_by(
name: meta[:name], name: meta[:name],
@ -309,24 +301,6 @@ class Package < ApplicationModel
true true
end 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) def self._parse(xml)
logger.debug xml.inspect logger.debug xml.inspect
begin begin
@ -497,8 +471,6 @@ class Package < ApplicationModel
Package::Migration.create( name: package.underscore, version: version ) Package::Migration.create( name: package.underscore, version: version )
end end
# reload new files
Package.reload_classes
} }
end end
end end