Skip to content

Commit

Permalink
Merge pull request #6667 from bgeuken/fix_autocomplete_
Browse files Browse the repository at this point in the history
Add limit to project autocomplete
  • Loading branch information
bgeuken committed Dec 19, 2018
2 parents 6497d95 + ec60a79 commit 3a68c38
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/project.rb
Expand Up @@ -91,7 +91,7 @@ def autocomplete(search)
where.not('name rlike ?', ::Configuration.unlisted_projects_filter) if ::Configuration.unlisted_projects_filter.present?
}
scope :remote, -> { where('NOT ISNULL(projects.remoteurl)') }
scope :autocomplete, ->(search) { where('lower(name) like lower(?)', "#{search}%").order(:name) }
scope :autocomplete, ->(search) { where('lower(name) like lower(?)', "#{search}%").order(:name).limit(50) }

# will return all projects with attribute 'OBS:ImageTemplates'
scope :local_image_templates, lambda {
Expand Down

0 comments on commit 3a68c38

Please sign in to comment.