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
3333 'content_type' : asset_content_type ,
3434 'file_size' : asset_file_size ,
3535 'updated_at' : asset_updated_at
36- }
36+ } ,
37+ 'asset_field_type_id' : id
3738 }
3839 end
3940
@@ -119,17 +120,9 @@ def existing_metadata
119120 metadata . except! ( :existing_data )
120121
121122 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 ]
123124 end
124125
125126 metadata
126127 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
135128end
You can’t perform that action at this time.
0 commit comments