Refactor DataUpdateScript to make its code simpler (#11263)

* Update data_update_script.rb

* Fix wrong arguments.
This commit is contained in:
turara 2020-11-05 16:19:36 +09:00 committed by GitHub
parent 01725d9344
commit 06c561c418
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,7 @@ class DataUpdateScript < ApplicationRecord
def scripts_to_run
insert_new_scripts
enqueued.where(id: ids).order(file_name: :asc)
enqueued.order(file_name: :asc)
end
# true if there are more files on disk or any scripts to run, false otherwise
@ -29,7 +29,7 @@ class DataUpdateScript < ApplicationRecord
def filenames
Dir.glob("*.rb", base: DIRECTORY).map do |f|
Pathname.new(f).basename(".rb").to_s
File.basename(f, ".rb")
end
end