Commit a9e3deea

mo khan <mo@mokhan.ca>
2013-12-30 18:02:52
update timestamp of creation when a new image is uploaded or if it is favorited.
1 parent c6a95ac
Changed files (2)
app/models/favorite.rb
@@ -1,4 +1,4 @@
 class Favorite < ActiveRecord::Base
   belongs_to :user
-  belongs_to :creation, :counter_cache => true
+  belongs_to :creation, :counter_cache => true, touch: true
 end
app/models/photo.rb
@@ -1,5 +1,5 @@
 class Photo < ActiveRecord::Base
-  belongs_to :creation, :counter_cache => true
+  belongs_to :creation, :counter_cache => true, touch: true
   validates :image,  :presence => true
   mount_uploader :image, PhotoUploader
   process_in_background :image if Rails.env.test?