Permalink
Browse files

removed unnecessary query to just delete a conversation

  • Loading branch information...
tomcz committed Mar 11, 2010
1 parent 5bf67be commit af25aead9d4fceb53d88eca9322261ac135d5e6c
Showing with 3 additions and 2 deletions.
  1. +3 −2 app/models/conversation.rb
@@ -18,8 +18,9 @@ def self.get_or_create(uuid)
end
def self.destroy_if_exists(uuid)
- if uuid.to_s != 'new' and self.exists? uuid
- self.destroy uuid
+ unless uuid.to_s == 'new'
+ conversation = self.find_by_uuid(uuid)
+ conversation.destroy if conversation
end
end

0 comments on commit af25aea

Please sign in to comment.