oops, migration was flipping

This commit is contained in:
Sam 2015-01-08 15:26:15 +11:00
parent 69cfab62b8
commit 03388e11ab
2 changed files with 2 additions and 1 deletions

View File

@ -4,7 +4,7 @@ class AddLikedAndBookmarkedToTopicUser < ActiveRecord::Migration
add_column :topic_users, :bookmarked, :boolean, default: false
# 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
SET #{name} = true
WHERE EXISTS (SELECT 1 FROM post_actions pa

View File

@ -151,6 +151,7 @@ describe PostAction do
tu = TopicUser.get(post.topic, codinghorror)
expect(tu.liked).to be true
expect(tu.bookmarked).to be false
end