Commit 033e8e5c authored by Steven Hancock's avatar Steven Hancock
Browse files

Fix ActiveRecord queries - take two

parent 79b7d381
......@@ -85,7 +85,7 @@ class Person < ActiveRecord::Base
where(:aspect_memberships => {:aspect_id => aspect_ids})
}
scope :profile_tagged_with, lambda{|tag_name| joins(:profile => :tags).where(:profile => {:tags => {:name => tag_name}}).where('profiles.searchable IS TRUE') }
scope :profile_tagged_with, lambda{|tag_name| joins(:profile => :tags).where(:tags => {:name => tag_name}).where('profiles.searchable IS TRUE') }
scope :who_have_reshared_a_users_posts, lambda{|user|
joins(:posts).where(:posts => {:root_guid => StatusMessage.guids_for_author(user.person), :type => 'Reshare'} )
......
......@@ -5,7 +5,7 @@ class TagFollowing < ActiveRecord::Base
validates_uniqueness_of :tag_id, :scope => :user_id
def self.user_is_following?(user, tagname)
tagname.nil? ? false : joins(:tag).where(:tags => {:name => tagname.downcase}, :user_id => user.id).exists?
tagname.nil? ? false : joins(:tag).where(:tags => {:name => tagname.downcase}).where(:user_id => user.id).exists?
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment