Skip to content
Browse files

fix #882 if preview exists it should be the only media record

  • Loading branch information...
1 parent 0fc9037 commit d0537b10a333db2c7d71684a3e9b70a6c930ed02 @mfrederickson mfrederickson committed
Showing with 1 addition and 0 deletions.
  1. +1 −0 app/controllers/contents_controller.rb
View
1 app/controllers/contents_controller.rb
@@ -111,6 +111,7 @@ def create
# only reassign if not already assigned
if @media[:key] == 'preview' && @media[:attachable_id] == 0
@media[:key] = 'original'
+ @content.media.clear
@content.media.concat(@media)
end
end

0 comments on commit d0537b1

Please sign in to comment.
Something went wrong with that request. Please try again.