Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/pull/4136'
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Aug 3, 2023
2 parents eae9c15 + 68fa607 commit a9b616a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ApplicationController < ActionController::Base

def authorize_web
if session[:user]
self.current_user = User.where(:id => session[:user]).where("status IN ('active', 'confirmed', 'suspended')").first
self.current_user = User.where(:id => session[:user], :status => %w[active confirmed suspended]).first

if session[:fingerprint] &&
session[:fingerprint] != current_user.fingerprint
Expand Down
2 changes: 1 addition & 1 deletion app/models/trace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Trace < ApplicationRecord
has_many :points, :class_name => "Tracepoint", :foreign_key => "gpx_id", :dependent => :delete_all, :inverse_of => :trace

scope :visible, -> { where(:visible => true) }
scope :visible_to, ->(u) { visible.where("visibility IN ('public', 'identifiable') OR user_id = ?", u) }
scope :visible_to, ->(u) { visible.where(:visibility => %w[public identifiable]).or(visible.where(:user => u)) }
scope :visible_to_all, -> { where(:visibility => %w[public identifiable]) }
scope :tagged, ->(t) { joins(:tags).where(:gpx_file_tags => { :tag => t }) }

Expand Down

0 comments on commit a9b616a

Please sign in to comment.