Set original filename data for uploaded files.
This commit is contained in:
parent
e2391d8635
commit
f95815d952
2 changed files with 18 additions and 1 deletions
|
@ -0,0 +1,17 @@
|
|||
class SetOriginalFilenameForUploaders < ActiveRecord::Migration
|
||||
def change
|
||||
PieceJustificative.find_each do |pj|
|
||||
if pj.original_filename.nil?
|
||||
pj.original_filename = pj.content_identifier
|
||||
pj.save!
|
||||
end
|
||||
end
|
||||
|
||||
Cerfa.find_each do |cerfa|
|
||||
if cerfa.original_filename.nil?
|
||||
cerfa.original_filename = cerfa.content_identifier
|
||||
cerfa.save!
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 20160513093425) do
|
||||
ActiveRecord::Schema.define(version: 20160524093540) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
|
Loading…
Reference in a new issue