commented out retraction on unfriending due to ROXML messing things up
.
This commit is contained in:
parent
f2d7f35b84
commit
d6bc93fb96
1 changed files with 8 additions and 3 deletions
|
|
@ -4,7 +4,6 @@ class User
|
|||
devise :database_authenticatable, :registerable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
|
||||
#before_validation_on_create :assign_key
|
||||
|
||||
before_validation :do_bad_things
|
||||
|
|
@ -73,7 +72,7 @@ class User
|
|||
end
|
||||
|
||||
def unfriend(friend_id)
|
||||
bad_friend = Person.first(:id => friend_id)
|
||||
bad_friend = Person.first(:_id => friend_id)
|
||||
|
||||
|
||||
puts bad_friend.users.count
|
||||
|
|
@ -81,12 +80,18 @@ class User
|
|||
self.friend_ids.delete( friend_id )
|
||||
self.save
|
||||
|
||||
bad_friend.users.delete( self.id )
|
||||
|
||||
|
||||
puts bad_friend.users.inspect
|
||||
|
||||
|
||||
|
||||
puts bad_friend.users.count
|
||||
|
||||
if bad_friend
|
||||
Retraction.for(self).push_to_url(bad_friend.url)
|
||||
puts bad_friend.url
|
||||
#Retraction.for(self).push_to_url(bad_friend.url)
|
||||
bad_friend.destroy if bad_friend.users.count == 0
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue