summaryrefslogtreecommitdiff
path: root/help/app/models/ticket_comment.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2012-10-29 19:19:35 +0100
committerAzul <azul@leap.se>2012-10-29 19:19:35 +0100
commit428aea3c577c44a3bb13cced23c5c0cafc5b4d93 (patch)
treee36349452e599c11b67e1912df2e68db5140c504 /help/app/models/ticket_comment.rb
parent3ba2e664a26e96a93c8640b57241af6386db361e (diff)
parent56273c13f54a872d02db286c90a8d5103cf7a663 (diff)
Merge branch 'help_develop' into develop
Diffstat (limited to 'help/app/models/ticket_comment.rb')
-rw-r--r--help/app/models/ticket_comment.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/help/app/models/ticket_comment.rb b/help/app/models/ticket_comment.rb
index 652133a..9026bc1 100644
--- a/help/app/models/ticket_comment.rb
+++ b/help/app/models/ticket_comment.rb
@@ -2,13 +2,15 @@ class TicketComment
include CouchRest::Model::Embeddable
#belongs_to :ticket #is this best way to do it? will want to access all of a tickets comments, so maybe this isn't the way?
- property :posted_by, Integer, :protected => true# maybe this should be current_user if that is set, meaning the user is logged in #String # user??
+ property :posted_by, Integer#, :protected => true# maybe this should be current_user if that is set, meaning the user is logged in #String # user??
# if the current user is not set, then we could just say the comment comes from an 'unauthenticated user', which would be somebody with the secret URL
- property :posted_at, Time, :protected => true
+ 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
- before_validation :set_time#, :set_posted_by
+
+ validates :body, :presence => true
+ #before_validation :set_time#, :set_posted_by
#design do
# view :by_posted_at
@@ -18,10 +20,14 @@ class TicketComment
def is_comment_validated?
!!posted_by
end
-
+
+=begin
+ #TODO.
+ #this is resetting all comments associated with the ticket:
def set_time
self.posted_at = Time.now
end
+=end
=begin
def set_posted_by