diff --git a/app/controllers/favorite_groups_controller.rb b/app/controllers/favorite_groups_controller.rb index 035bb7bbc..21b4afc0b 100644 --- a/app/controllers/favorite_groups_controller.rb +++ b/app/controllers/favorite_groups_controller.rb @@ -63,7 +63,7 @@ class FavoriteGroupsController < ApplicationController @favorite_group = FavoriteGroup.find(params[:id]) check_privilege(@favorite_group) @post = Post.find(params[:post_id]) - @favorite_group.add!(@post) + @favorite_group.add!(@post.id) end private diff --git a/app/models/favorite_group.rb b/app/models/favorite_group.rb index d9d847392..cf78d8b7d 100644 --- a/app/models/favorite_group.rb +++ b/app/models/favorite_group.rb @@ -176,6 +176,7 @@ class FavoriteGroup < ApplicationRecord return if contains?(post_id) clear_post_id_array + puts ">>> post_id=#{post_id} post_ids=#{post_ids.inspect}" update_attributes(:post_ids => add_number_to_string(post_id, post_ids)) end