fix ActivityStreams::Photo migration

This commit is contained in:
Jonne Haß 2013-07-31 20:57:01 +02:00
parent 2916b8b216
commit 7057f77924

View file

@ -1,8 +1,9 @@
class MigrateActivityStreamToStatusMessage < ActiveRecord::Migration
class Post < ActiveRecord::Base; self.inheritance_column = false; end
def up
posts_stream_photos = Post.where(:type => 'ActivityStreams::Photo')
posts_stream_photos = Post.where(type: 'ActivityStreams::Photo')
posts_stream_photos.each do |p|
p.update_attributes(:text => "#{p.text} ![](#{p.image_url})", :type => "StatusMessage", without_protection: true)
p.update_attributes({text: "#{p.text} ![](#{p.image_url})", type: "StatusMessage"}, without_protection: true)
end
end