[#345] remove deprecation warning with eager loading table that are referenced in a string SQL snippet
This commit is contained in:
parent
2a8fa0e64b
commit
46c3b8cabe
|
@ -31,7 +31,8 @@ class Issue < ActiveRecord::Base
|
||||||
# Using mb_chars for correct transform to lowercase ('Русский Текст'.downcase => "Русский Текст")
|
# Using mb_chars for correct transform to lowercase ('Русский Текст'.downcase => "Русский Текст")
|
||||||
scope :search, ->(q) { where("#{table_name}.title ILIKE ?", "%#{q.mb_chars.downcase}%") if q.present? }
|
scope :search, ->(q) { where("#{table_name}.title ILIKE ?", "%#{q.mb_chars.downcase}%") if q.present? }
|
||||||
scope :without_pull_requests, -> {
|
scope :without_pull_requests, -> {
|
||||||
where('NOT EXISTS (select null from pull_requests as pr where pr.issue_id = issues.id)')
|
where('NOT EXISTS (select null from pull_requests as pr where pr.issue_id = issues.id)').
|
||||||
|
references(:pull_requests)
|
||||||
}
|
}
|
||||||
|
|
||||||
def assign_uname
|
def assign_uname
|
||||||
|
|
Loading…
Reference in New Issue