summaryrefslogtreecommitdiff
path: root/help/app/models
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2012-11-02 15:10:45 -0700
committerjessib <jessib@riseup.net>2012-11-02 15:10:45 -0700
commitfb1c8e60335fefc55191eee16d83f53d2e9a2031 (patch)
treed29fd3fd7867711c8ffb9231077a245fec7c8b1c /help/app/models
parent4db41d772725387ba36240cf8f3529780e896755 (diff)
Some rough functionality for tickets, like showing ticket list for admins, and initial way to close tickets.
Diffstat (limited to 'help/app/models')
-rw-r--r--help/app/models/ticket.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/help/app/models/ticket.rb b/help/app/models/ticket.rb
index 0407012..6301e9e 100644
--- a/help/app/models/ticket.rb
+++ b/help/app/models/ticket.rb
@@ -38,6 +38,9 @@ class Ticket < CouchRest::Model::Base
design do
view :by_title
view :by_is_open
+ view :by_created_by
+ view :by_is_open_and_created_by
+
end
validates :title, :presence => true
@@ -78,7 +81,6 @@ class Ticket < CouchRest::Model::Base
end
def comments_attributes=(attributes)
-
comment = TicketComment.new(attributes.values.first) #TicketComment.new(attributes)
#comment.posted_by = User.current.id if User.current #we want to avoid User.current, and current_user won't work here. instead will set in tickets_controller
# what about: comment.posted_by = self.updated_by (will need to add ticket.updated_by)