Rename scope
This commit is contained in:
@@ -10,7 +10,7 @@ class CardsController < ApplicationController
|
||||
|
||||
def index
|
||||
@considering = page_and_filter_for @filter.with(engagement_status: "considering"), per_page: PAGE_SIZE
|
||||
@doing = page_and_filter_for @filter.with(engagement_status: "doing"), cards: @filter.cards.golden_first, per_page: PAGE_SIZE
|
||||
@doing = page_and_filter_for @filter.with(engagement_status: "doing"), cards: @filter.cards.with_golden_first, per_page: PAGE_SIZE
|
||||
@closed = page_and_filter_for @filter.with(indexed_by: "closed"), per_page: PAGE_SIZE
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ module Card::Golden
|
||||
|
||||
has_one :goldness, dependent: :destroy, class_name: "Card::Goldness"
|
||||
|
||||
scope :golden_first, -> do
|
||||
scope :with_golden_first, -> do
|
||||
left_outer_joins(:goldness).tap do |relation|
|
||||
relation.order_values.unshift("card_goldnesses.id IS NULL")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user