Skip to content

Commit

Permalink
removing mysql fixes (it didn't work)
Browse files Browse the repository at this point in the history
  • Loading branch information
milaaraujo committed Aug 11, 2018
1 parent 79759a6 commit 9aa3ef5
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions app/services/srch_scope.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,12 @@ def self.find_questions(input, limit, order)
end

def self.find_locations(limit, user_tag = nil)
user_locations =
if ActiveRecord::Base.connection.adapter_name == 'Mysql2'
User.select('rusers.*, node_revisions.timestamp')
.where('rusers.status <> 0')\
.joins(:user_tags)\
.where('value LIKE "lat:%"')\
.joins(:revisions)\
.order("node_revisions.timestamp DESC")\
.distinct
else
User.where('rusers.status <> 0')\
.joins(:user_tags)\
.where('value LIKE "lat:%"')\
.joins(:revisions)\
.order("node_revisions.timestamp DESC")\
.distinct
end

user_locations = User.where('rusers.status <> 0')\
.joins(:user_tags)\
.where('value LIKE "lat:%"')\
.joins(:revisions)\
.order("node_revisions.timestamp DESC")\
.distinct
if user_tag.present?
user_locations = User.joins(:user_tags)\
.where('user_tags.value LIKE ?', user_tag)\
Expand Down

0 comments on commit 9aa3ef5

Please sign in to comment.