Reload new files (only if we are in uninstall modus - not on install/upgrade).
This commit is contained in:
parent
43ec6fd79e
commit
649cf8af10
1 changed files with 12 additions and 10 deletions
|
@ -40,7 +40,7 @@ class Package < ApplicationModel
|
||||||
file.close
|
file.close
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return package.to_s
|
package.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
# Package.auto_install
|
# Package.auto_install
|
||||||
|
@ -57,7 +57,7 @@ class Package < ApplicationModel
|
||||||
data.each {|file|
|
data.each {|file|
|
||||||
self.install( :file => path + '/' + file )
|
self.install( :file => path + '/' + file )
|
||||||
}
|
}
|
||||||
return data
|
data
|
||||||
end
|
end
|
||||||
|
|
||||||
# Package.unlink_all
|
# Package.unlink_all
|
||||||
|
@ -88,7 +88,7 @@ class Package < ApplicationModel
|
||||||
raise "Can't link package, '#{package_base_dir}' is no package source directory!"
|
raise "Can't link package, '#{package_base_dir}' is no package source directory!"
|
||||||
end
|
end
|
||||||
logger.debug package.inspect
|
logger.debug package.inspect
|
||||||
return package
|
package
|
||||||
end
|
end
|
||||||
|
|
||||||
# Package.unlink('/path/to/src/extention')
|
# Package.unlink('/path/to/src/extention')
|
||||||
|
@ -248,7 +248,7 @@ class Package < ApplicationModel
|
||||||
|
|
||||||
# prebuild assets
|
# prebuild assets
|
||||||
|
|
||||||
return true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
# Package.reinstall( package_name )
|
# Package.reinstall( package_name )
|
||||||
|
@ -294,8 +294,10 @@ class Package < ApplicationModel
|
||||||
|
|
||||||
# prebuild assets
|
# prebuild assets
|
||||||
|
|
||||||
# reload new files
|
# reload new files (only if we are in uninstall modus)
|
||||||
|
if !data[:migration_not_down]
|
||||||
Package.reload_classes
|
Package.reload_classes
|
||||||
|
end
|
||||||
|
|
||||||
# delete package
|
# delete package
|
||||||
record = Package.where(
|
record = Package.where(
|
||||||
|
@ -304,7 +306,7 @@ class Package < ApplicationModel
|
||||||
).first
|
).first
|
||||||
record.destroy
|
record.destroy
|
||||||
|
|
||||||
return true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
# reload .rb files in case they have changed
|
# reload .rb files in case they have changed
|
||||||
|
@ -333,7 +335,7 @@ class Package < ApplicationModel
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
logger.debug package.inspect
|
logger.debug package.inspect
|
||||||
return package
|
package
|
||||||
end
|
end
|
||||||
|
|
||||||
def self._get_bin( name, version )
|
def self._get_bin( name, version )
|
||||||
|
@ -430,7 +432,7 @@ class Package < ApplicationModel
|
||||||
File.rename( backup_location, location )
|
File.rename( backup_location, location )
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
true
|
||||||
end
|
end
|
||||||
|
|
||||||
class Migration < ApplicationModel
|
class Migration < ApplicationModel
|
||||||
|
|
Loading…
Reference in a new issue