myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2672] trunk: Properly correct for oauth tokens w


From: noreply
Subject: [myexperiment-hackers] [2672] trunk: Properly correct for oauth tokens whose client applications have been
Date: Mon, 15 Aug 2011 05:37:35 -0400 (EDT)

Revision
2672
Author
dtm
Date
2011-08-15 05:37:34 -0400 (Mon, 15 Aug 2011)

Log Message

Properly correct for oauth tokens whose client applications have been
deleted.

Modified Paths

Added Paths

Diff

Modified: trunk/app/views/oauth/index.rhtml (2671 => 2672)


--- trunk/app/views/oauth/index.rhtml	2011-08-12 17:09:31 UTC (rev 2671)
+++ trunk/app/views/oauth/index.rhtml	2011-08-15 09:37:34 UTC (rev 2672)
@@ -4,7 +4,6 @@
 <table>
 	<tr><th>Application</th><th>Issued</th><th>&nbsp;</th></tr>
 	<address@hidden do |token|%>
-<% if token.client_application -%>
 		<tr>
 			<td><%=link_to token.client_application.name,token.client_application.url%></td>
 			<td><%=token.authorized_at%></td>
@@ -15,7 +14,6 @@
 				<%end%>
 			</td>
 		</tr>
-<%end%>
 	<%end%>
 	
 </table>

Added: trunk/db/migrate/091_fix_orphaned_oauth_tokens.rb (0 => 2672)


--- trunk/db/migrate/091_fix_orphaned_oauth_tokens.rb	                        (rev 0)
+++ trunk/db/migrate/091_fix_orphaned_oauth_tokens.rb	2011-08-15 09:37:34 UTC (rev 2672)
@@ -0,0 +1,18 @@
+# myExperiment: db/migrate/091_fix_orphaned_oauth_tokens.rb
+#
+# Copyright (c) 2010 University of Manchester and the University of Southampton.
+# See license.txt for details.
+
+class FixOrphanedOauthTokens < ActiveRecord::Migration
+  def self.up
+
+    OauthToken.find(:all).each do |t|
+      if t.client_application.nil?
+        t.destroy()
+      end
+    end
+  end
+
+  def self.down
+  end
+end

reply via email to

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