to id so that change of group works
This commit is contained in:
parent
6a48c07c90
commit
1d69b88e2e
2 changed files with 2 additions and 2 deletions
|
|
@ -21,7 +21,7 @@ class Group
|
||||||
end
|
end
|
||||||
|
|
||||||
def posts_by_person_id( id )
|
def posts_by_person_id( id )
|
||||||
id = ensure_bson id
|
id = id.to_id
|
||||||
posts.detect{|x| x.person.id == id }
|
posts.detect{|x| x.person.id == id }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ class User
|
||||||
puts posts_to_move.inspect
|
puts posts_to_move.inspect
|
||||||
to_group.people << friend
|
to_group.people << friend
|
||||||
to_group.posts << posts_to_move
|
to_group.posts << posts_to_move
|
||||||
from_group.person_ids.delete(ensure_bson(friend.id))
|
from_group.person_ids.delete(friend.id.to_id)
|
||||||
posts_to_move.each{ |x| from_group.post_ids.delete(x.id)}
|
posts_to_move.each{ |x| from_group.post_ids.delete(x.id)}
|
||||||
from_group.save
|
from_group.save
|
||||||
to_group.save
|
to_group.save
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue