diff options
Diffstat (limited to 'app/models/project.rb')
-rw-r--r-- | app/models/project.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/app/models/project.rb b/app/models/project.rb index 698e742de48..301ff71cc01 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -235,8 +235,8 @@ class Project < ActiveRecord::Base scope :inside_path, ->(path) do # We need routes alias rs for JOIN so it does not conflict with # includes(:route) which we use in ProjectsFinder. - joins("INNER JOIN routes rs ON rs.source_id = projects.id AND rs.source_type = 'Project'") - .where('rs.path LIKE ?', "#{path}/%") + joins("INNER JOIN routes rs ON rs.source_id = projects.id AND rs.source_type = 'Project'"). + where('rs.path LIKE ?', "#{path}/%") end # "enabled" here means "not disabled". It includes private features! @@ -313,9 +313,9 @@ class Project < ActiveRecord::Base pattern = "%#{query}%" projects = select(:id).where( - ptable[:path].matches(pattern) - .or(ptable[:name].matches(pattern)) - .or(ptable[:description].matches(pattern)) + ptable[:path].matches(pattern). + or(ptable[:name].matches(pattern)). + or(ptable[:description].matches(pattern)) ) # We explicitly remove any eager loading clauses as they're: @@ -324,10 +324,10 @@ class Project < ActiveRecord::Base # 2. Combined with .joins(:namespace) lead to all columns from the # projects & namespaces tables being selected, leading to a SQL error # due to the columns of all UNION'd queries no longer being the same. - namespaces = select(:id) - .except(:includes) - .joins(:namespace) - .where(ntable[:name].matches(pattern)) + namespaces = select(:id). + except(:includes). + joins(:namespace). + where(ntable[:name].matches(pattern)) union = Gitlab::SQL::Union.new([projects, namespaces]) @@ -369,8 +369,8 @@ class Project < ActiveRecord::Base end def trending - joins('INNER JOIN trending_projects ON projects.id = trending_projects.project_id') - .reorder('trending_projects.id ASC') + joins('INNER JOIN trending_projects ON projects.id = trending_projects.project_id'). + reorder('trending_projects.id ASC') end def cached_count |