2
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2025-09-06 10:50:21 +08:00

Improved private message user removal, locale edit

replaced array iteration with findProperty (will be renamed and aliased to findBy with Ember 1.1)
added modal dialog to verify
catched nil-error on topic.rb
This commit is contained in:
Claus Strasburger 2013-10-02 19:11:48 +02:00
parent b089805dc0
commit 15a973fd45
5 changed files with 20 additions and 7 deletions

View file

@ -382,7 +382,12 @@ class Topic < ActiveRecord::Base
def remove_allowed_user(username)
user = User.where(username: username).first
if user
topic_allowed_users.where(user_id: user.id).first.destroy
topic_user = topic_allowed_users.where(user_id: user.id).first
if topic_user
topic_user.destroy
else
false
end
end
end