File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,8 @@ def data
33
33
'content_type' : asset_content_type ,
34
34
'file_size' : asset_file_size ,
35
35
'updated_at' : asset_updated_at
36
- }
36
+ } ,
37
+ 'asset_field_type_id' : id
37
38
}
38
39
end
39
40
@@ -119,17 +120,9 @@ def existing_metadata
119
120
metadata . except! ( :existing_data )
120
121
121
122
unless @existing_data . empty?
122
- metadata [ :path ] = updated_url ( @existing_data [ 'asset' ] [ 'url' ] )
123
+ metadata [ :path ] . gsub ( ":id" , @existing_data [ 'asset_field_type_id' ] ) if metadata [ :path ]
123
124
end
124
125
125
126
metadata
126
127
end
127
-
128
- def updated_url ( path )
129
- # Take the parse path of the existing URL and drop the first '/',
130
- # that will be added later and we don't want to duplicate it
131
- # Then remove the old file extension and replace it with the paperclipp'd new one
132
- new_path = URI . parse ( path ) . path . slice ( 1 ..-1 )
133
- new_path . gsub ( File . extname ( path ) , ".:extension" )
134
- end
135
128
end
You can’t perform that action at this time.
0 commit comments