Fixes #19: Unable to delete my comments

This commit is contained in:
albert
2011-09-14 12:52:49 -04:00
parent e578be0111
commit 1c8a893450
4 changed files with 26 additions and 3 deletions

View File

@@ -52,6 +52,10 @@ class Comment < ActiveRecord::Base
def creator_name
creator.name
end
def editable_by?(user)
creator_id == user.id || user.is_moderator?
end
end
Comment.connection.extend(PostgresExtensions)