diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index b788191f9..d99e35036 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -21,13 +21,13 @@ module ApplicationHelper def aspects_with_post aspects, post aspects.select do |aspect| - aspect.has_post?(post) + PostVisibility.exists?(:aspect_id => aspect.id, :post_id => post.id) end end def aspects_without_post aspects, post aspects.reject do |aspect| - aspect.has_post?(post) + PostVisibility.exists?(:aspect_id => aspect.id, :post_id => post.id) end end diff --git a/app/models/aspect.rb b/app/models/aspect.rb index 77a371f37..b6a99cef8 100644 --- a/app/models/aspect.rb +++ b/app/models/aspect.rb @@ -21,14 +21,6 @@ class Aspect < ActiveRecord::Base name.strip! end - def has_post? post - post_ids = post_visibilities.each { |pv| pv.post_id } - post_ids.each { |id| - return true if id == post.id - } - return false - end - def to_s name end