fixes #1384
This commit is contained in:
@@ -579,6 +579,10 @@ class Post < ActiveRecord::Base
|
|||||||
pool_string =~ /(?:\A| )pool:#{pool.id}(?:\Z| )/
|
pool_string =~ /(?:\A| )pool:#{pool.id}(?:\Z| )/
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def belongs_to_pool_with_id?(pool_id)
|
||||||
|
pool_string =~ /(?:\A| )pool:#{pool_id}(?:\Z| )/
|
||||||
|
end
|
||||||
|
|
||||||
def add_pool!(pool)
|
def add_pool!(pool)
|
||||||
return if belongs_to_pool?(pool)
|
return if belongs_to_pool?(pool)
|
||||||
return if pool.is_deleted?
|
return if pool.is_deleted?
|
||||||
|
|||||||
@@ -146,7 +146,7 @@ class PostPresenter < Presenter
|
|||||||
def pool_html(template)
|
def pool_html(template)
|
||||||
html = ["<ul>"]
|
html = ["<ul>"]
|
||||||
|
|
||||||
if template.params[:pool_id].present?
|
if template.params[:pool_id].present? && @post.belongs_to_pool_with_id?(template.params[:pool_id])
|
||||||
pool = Pool.where(:id => template.params[:pool_id]).first
|
pool = Pool.where(:id => template.params[:pool_id]).first
|
||||||
return if pool.nil?
|
return if pool.nil?
|
||||||
html += pool_link_html(template, pool, :include_rel => true)
|
html += pool_link_html(template, pool, :include_rel => true)
|
||||||
|
|||||||
Reference in New Issue
Block a user