mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Fix active storage migration script (#2060)
* Fix active storage migration script * Update check logic
This commit is contained in:
parent
4639d4d1d0
commit
64306cfb2a
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,8 @@ class ConvertToActiveStorage < ActiveRecord::Migration[5.2]
|
||||||
|
|
||||||
transaction do
|
transaction do
|
||||||
models.each do |model|
|
models.each do |model|
|
||||||
|
next unless ActiveRecord::Base.connection.table_exists?(model.table_name)
|
||||||
|
|
||||||
attachments = model.column_names.map do |c|
|
attachments = model.column_names.map do |c|
|
||||||
$1 if c =~ /(.+)_file_name$/
|
$1 if c =~ /(.+)_file_name$/
|
||||||
end.compact
|
end.compact
|
||||||
|
|
Loading…
Reference in a new issue