summaryrefslogtreecommitdiff
path: root/help/app/models/ticket_comment.rb
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-01-17 10:41:09 -0800
committerjessib <jessib@riseup.net>2013-01-17 10:41:09 -0800
commit6347fdbe0d932e78dfa8259bf81355edb19508e9 (patch)
tree5ec11b9600d4330ec94f56dda779634cd7dcae1b /help/app/models/ticket_comment.rb
parentb550cd14f33b9664fe6b547dc56107fae7d12caf (diff)
parent7d7741f7d26c3ae7ee1dc347a6b1a1142a3c2824 (diff)
Merge pull request #10 from leapcode/feature/unauthenticated_tickets
Rough functionality for unauthenticated tickets.
Diffstat (limited to 'help/app/models/ticket_comment.rb')
-rw-r--r--help/app/models/ticket_comment.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/help/app/models/ticket_comment.rb b/help/app/models/ticket_comment.rb
index 49e5c6c..1df7eec 100644
--- a/help/app/models/ticket_comment.rb
+++ b/help/app/models/ticket_comment.rb
@@ -7,6 +7,7 @@ class TicketComment
property :posted_at, Time#, :protected => true
#property :posted_verified, TrueClass, :protected => true #should be true if current_user is set when the comment is created
property :body, String
+ property :private, TrueClass # private comments are only viewable by admins
# ? timestamps!
validates :body, :presence => true
@@ -21,6 +22,10 @@ class TicketComment
!!posted_by
end
+ def posted_by_user
+ User.find(self.posted_by)
+ end
+
=begin
#TODO.
#this is resetting all comments associated with the ticket: