Skip to content

Commit

Permalink
Version that works on Travis
Browse files Browse the repository at this point in the history
  • Loading branch information
milaaraujo committed Aug 11, 2018
1 parent e4a72e5 commit 3d7c5e4
Showing 1 changed file with 6 additions and 17 deletions.
23 changes: 6 additions & 17 deletions app/services/srch_scope.rb
Expand Up @@ -66,23 +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 3d7c5e4

Please sign in to comment.