myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [2906] trunk/app/models: removed rails 1 workarou


From: noreply
Subject: [myexperiment-hackers] [2906] trunk/app/models: removed rails 1 workaround for the touch method
Date: Thu, 19 Jan 2012 04:51:22 -0500 (EST)

Revision
2906
Author
dgc
Date
2012-01-19 04:51:21 -0500 (Thu, 19 Jan 2012)

Log Message

removed rails 1 workaround for the touch method

Modified Paths

Diff

Modified: trunk/app/models/pack.rb (2905 => 2906)


--- trunk/app/models/pack.rb	2012-01-17 15:24:03 UTC (rev 2905)
+++ trunk/app/models/pack.rb	2012-01-19 09:51:21 UTC (rev 2906)
@@ -942,9 +942,4 @@
     
     boost
   end
-
-  # touch method that mimics the simple use of the rails 2 touch method
-  def touch
-    update_attribute(:updated_at, Time.now)
-  end
 end

Modified: trunk/app/models/pack_contributable_entry.rb (2905 => 2906)


--- trunk/app/models/pack_contributable_entry.rb	2012-01-17 15:24:03 UTC (rev 2905)
+++ trunk/app/models/pack_contributable_entry.rb	2012-01-19 09:51:21 UTC (rev 2906)
@@ -75,7 +75,6 @@
   end
 
   def touch_pack
-    # Rails 2 - use pack.destroyed? instead of pack.contribution.nil?
-    pack.touch unless pack.contribution.nil?
+    pack.touch unless pack.destroyed?
   end
 end

Modified: trunk/app/models/pack_remote_entry.rb (2905 => 2906)


--- trunk/app/models/pack_remote_entry.rb	2012-01-17 15:24:03 UTC (rev 2905)
+++ trunk/app/models/pack_remote_entry.rb	2012-01-19 09:51:21 UTC (rev 2906)
@@ -28,8 +28,7 @@
   end
 
   def touch_pack
-    # Rails 2 - use pack.destroyed? instead of pack.contribution.nil?
-    pack.touch unless pack.contribution.nil?
+    pack.touch unless pack.destroyed?
   end
 
   def available?

Modified: trunk/app/models/relationship.rb (2905 => 2906)


--- trunk/app/models/relationship.rb	2012-01-17 15:24:03 UTC (rev 2905)
+++ trunk/app/models/relationship.rb	2012-01-19 09:51:21 UTC (rev 2906)
@@ -18,8 +18,7 @@
   after_destroy :touch_context
 
   def touch_context
-    # Rails 2 - use context.destroyed? instead of context.contribution.nil?
-    context.touch if !context.contribution.nil? && context.respond_to?(:touch)
+    context.touch unless context.destroyed?
   end
 end
 

reply via email to

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