[#345] fix error with quotes

This commit is contained in:
Alexander Machehin 2014-03-12 19:14:19 +06:00
parent d78879c691
commit 9fb226acef
1 changed files with 1 additions and 1 deletions

View File

@ -67,7 +67,7 @@ class Project < ActiveRecord::Base
scope :by_name, ->(name) { where('projects.name ILIKE ?', name) if name.present? }
scope :by_owner_and_name, ->(*params) {
term = params.map(&:strip).join('/').downcase
where('lower(concat(owner_uname, '/', name)) ILIKE ?', "%#{term}%") if term.present?
where("lower(concat(owner_uname, '/', name)) ILIKE ?", "%#{term}%") if term.present?
}
scope :by_visibilities, ->(v) { where(visibility: v) }
scope :opened, -> { where(visibility: 'open') }