Skip to content

Commit f493d35

Browse files
committed
Migration that corrects overly specific attachment types
1 parent fc29e3e commit f493d35

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Browsercms354 < ActiveRecord::Migration
2+
def up
3+
# Attachments should not be overly specific, since it prevents joins from working.
4+
["Cms::ImageBlock", "Cms::FileBlock"].each do |old_type|
5+
Cms::Attachment.unscoped.update_all({:attachable_type => "Cms::AbstractFileBlock"}, {:attachable_type => old_type})
6+
end
7+
end
8+
end
9+

0 commit comments

Comments
 (0)