Added Package.migration_execute to execute all pending package migrations at once.

This commit is contained in:
Martin Edenhofer 2016-06-01 10:32:13 +02:00
parent 2137250bae
commit 2ac873886e

View file

@ -361,6 +361,22 @@ returns
record
end
=begin
execute all pending package migrations at once
Package.migration_execute
=end
def self.migration_execute
Package.all.each {|package|
json_file = Package._get_bin(package.name, package.version)
package = JSON.parse(json_file)
Package::Migration.migrate(package['name'])
}
end
def self._get_bin(name, version)
package = Package.find_by(
name: name,