mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
oops, migration was flipping
This commit is contained in:
@@ -4,7 +4,7 @@ class AddLikedAndBookmarkedToTopicUser < ActiveRecord::Migration
|
|||||||
add_column :topic_users, :bookmarked, :boolean, default: false
|
add_column :topic_users, :bookmarked, :boolean, default: false
|
||||||
|
|
||||||
# likes and bookmarks PostActionType.types[:like] and :bookmark which should not be used in a migration
|
# likes and bookmarks PostActionType.types[:like] and :bookmark which should not be used in a migration
|
||||||
{liked: 1, bookmarked: 2}.each do |name, type|
|
{liked: 2, bookmarked: 1}.each do |name, type|
|
||||||
execute "UPDATE topic_users
|
execute "UPDATE topic_users
|
||||||
SET #{name} = true
|
SET #{name} = true
|
||||||
WHERE EXISTS (SELECT 1 FROM post_actions pa
|
WHERE EXISTS (SELECT 1 FROM post_actions pa
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ describe PostAction do
|
|||||||
|
|
||||||
tu = TopicUser.get(post.topic, codinghorror)
|
tu = TopicUser.get(post.topic, codinghorror)
|
||||||
expect(tu.liked).to be true
|
expect(tu.liked).to be true
|
||||||
|
expect(tu.bookmarked).to be false
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user