This commit is contained in:
albert
2013-03-13 16:14:22 -04:00
parent e29d24b7eb
commit badf53f886

View File

@@ -1,6 +1,6 @@
module PoolVersionsHelper
def pool_version_diff(current)
prev = PoolVersion.where(["pool_id = ? and id < ?", current.pool_id, current.id]).order("updated_at desc").first
prev = PoolVersion.where(["pool_id = ? and updated_at < ?", current.pool_id, current.updated_at]).order("updated_at desc").first
if prev.nil?
return current.post_id_array.map {|x| '<ins><a href="/posts/' + x.to_s + '">' + x.to_s + '</a></ins>'}.join(" ").html_safe