diff options
author | jessib <jessib@riseup.net> | 2012-11-05 13:18:43 -0800 |
---|---|---|
committer | jessib <jessib@riseup.net> | 2012-11-05 13:18:43 -0800 |
commit | c7177593aaf2b1b8fd8dbd53b9cfb6562e1411d7 (patch) | |
tree | 476e067b49bc740890e44e5abbf42408ee41d6d2 /help/app/models | |
parent | 3515a598341282c20feb5950a81f43552280688d (diff) |
Use the same URL for viewing tickets when authenticated or not---the couchdb ID will be the random string for the secret URL.
Tickets created when user was unauthenticated will be viewable by anybody who knows the URL.
Diffstat (limited to 'help/app/models')
-rw-r--r-- | help/app/models/ticket.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/help/app/models/ticket.rb b/help/app/models/ticket.rb index 6301e9e..eaad574 100644 --- a/help/app/models/ticket.rb +++ b/help/app/models/ticket.rb @@ -23,14 +23,14 @@ class Ticket < CouchRest::Model::Base #property :user_verified, TrueClass, :default => false #will be true exactly when user is set #admins - property :code, String, :protected => true # only should be set if created_by is nil + #property :code, String, :protected => true # only should be set if created_by is nil #instead we will just use couchdb ID property :is_open, TrueClass, :default => true property :comments, [TicketComment] timestamps! #before_validation :set_created_by, :set_code, :set_email, :on => :create - before_validation :set_code, :set_email, :on => :create + before_validation :set_email, :on => :create #named_scope :open, :conditions => {:is_open => true} #?? @@ -59,10 +59,12 @@ class Ticket < CouchRest::Model::Base !!created_by end - def set_code +=begin + def set_code #let's not use this---can use same show url # ruby 1.9 provides url-safe option---this is not necessarily url-safe self.code = SecureRandom.hex(8) if !is_creator_validated? end +=end def set_email |