This commit is contained in:
r888888888
2017-09-15 11:23:03 -07:00
parent 0985f929cc
commit 2156c79543
2 changed files with 2 additions and 1 deletions

View File

@@ -63,7 +63,7 @@ class FavoriteGroupsController < ApplicationController
@favorite_group = FavoriteGroup.find(params[:id]) @favorite_group = FavoriteGroup.find(params[:id])
check_privilege(@favorite_group) check_privilege(@favorite_group)
@post = Post.find(params[:post_id]) @post = Post.find(params[:post_id])
@favorite_group.add!(@post) @favorite_group.add!(@post.id)
end end
private private

View File

@@ -176,6 +176,7 @@ class FavoriteGroup < ApplicationRecord
return if contains?(post_id) return if contains?(post_id)
clear_post_id_array 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)) update_attributes(:post_ids => add_number_to_string(post_id, post_ids))
end end