only touch post on comment creation, fix #1911

This commit is contained in:
Jonne Hass 2011-09-07 15:55:48 +02:00
parent bc4872d3a5
commit c0780f3af2

View file

@ -23,19 +23,26 @@ class Comment < ActiveRecord::Base
xml_attr :text
xml_attr :diaspora_handle
belongs_to :post, :touch => true
belongs_to :post
belongs_to :author, :class_name => 'Person'
validates_presence_of :text, :post
validates_length_of :text, :maximum => 2500
serialize :youtube_titles, Hash
before_save do
self.text.strip! unless self.text.nil?
end
after_save do
self.post.touch
end
def diaspora_handle
self.author.diaspora_handle
end
def diaspora_handle= nh
self.author = Webfinger.new(nh).fetch
end