Skip to content
Extraits de code Groupes Projets
Valider a819f38b rédigé par danielgrippi's avatar danielgrippi
Parcourir les fichiers

touch interacted_at on Post#after_create

parent a72a09a2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -48,6 +48,10 @@ class Post < ActiveRecord::Base ...@@ -48,6 +48,10 @@ class Post < ActiveRecord::Base
belongs_to :o_embed_cache belongs_to :o_embed_cache
after_create do
self.touch(:interacted_at)
end
#scopes #scopes
scope :includes_for_a_stream, includes(:o_embed_cache, {:author => :profile}, :mentions => {:person => :profile}) #note should include root and photos, but i think those are both on status_message scope :includes_for_a_stream, includes(:o_embed_cache, {:author => :profile}, :mentions => {:person => :profile}) #note should include root and photos, but i think those are both on status_message
......
...@@ -348,4 +348,13 @@ describe Post do ...@@ -348,4 +348,13 @@ describe Post do
end end
end end
end end
describe "#after_create" do
it "sets #interacted_at" do
post = Factory(:status_message)
post.interacted_at.should_not be_blank
end
end
end end
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter