myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [2332] trunk/lib/rest.rb: change to only require


From: noreply
Subject: [myexperiment-hackers] [2332] trunk/lib/rest.rb: change to only require enough letters to uniquely identify a curation tag
Date: Thu, 11 Feb 2010 10:56:30 -0500 (EST)

Revision
2332
Author
dgc
Date
2010-02-11 10:56:30 -0500 (Thu, 11 Feb 2010)

Log Message

change to only require enough letters to uniquely identify a curation tag

Modified Paths

Diff

Modified: trunk/lib/rest.rb (2331 => 2332)


--- trunk/lib/rest.rb	2010-02-11 15:24:53 UTC (rev 2331)
+++ trunk/lib/rest.rb	2010-02-11 15:56:30 UTC (rev 2332)
@@ -1664,6 +1664,16 @@
 
     # Start of curation hack
 
+    def match_tag_name(name)
+      matches = []
+
+      Conf.curation_types.each do |type|
+        matches.push type if type.starts_with?(name)
+      end
+
+      return matches[0] if matches.length == 1
+    end
+
     if comment[0..1].downcase == 'c:' && user && subject &&
         Conf.curators.include?(user.username)
 
@@ -1691,8 +1701,10 @@
             bit.downcase!
             bit.strip!
 
-            if Conf.curation_types.include?(bit)
-              events.push(CurationEvent.new(:category => bit,
+            curation_type = match_tag_name(bit)
+
+            if curation_type
+              events.push(CurationEvent.new(:category => curation_type,
                     :object => subject, :user => user, :details => details))
             else
               failed = true

reply via email to

[Prev in Thread] Current Thread [Next in Thread]