mirror of
https://github.com/docusealco/docuseal
synced 2026-11-09 23:42:32 -05:00
optimize query
This commit is contained in:
1 parent
d56c903596
commit
30704b59c2
1 file changed
+6
-2
@@ -13,7 +13,9 @@ class WebhookSettingsController < ApplicationController
|
|||||||
else
|
else
|
||||||
@webhook_events = @webhook_url.webhook_events
|
@webhook_events = @webhook_url.webhook_events
|
||||||
|
|
||||||
@webhook_events = @webhook_events.where(status: params[:status]) if %w[success error].include?(params[:status])
|
if %w[success error].include?(params[:status])
|
||||||
|
@webhook_events = @webhook_events.where(WebhookEvent.arel_table[:status].eq(params[:status]))
|
||||||
|
end
|
||||||
|
|
||||||
@pagy, @webhook_events = pagy(:countless, @webhook_events.order(id: :desc))
|
@pagy, @webhook_events = pagy(:countless, @webhook_events.order(id: :desc))
|
||||||
|
|
||||||
@@ -24,7 +26,9 @@ class WebhookSettingsController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@webhook_events = @webhook_url.webhook_events
|
@webhook_events = @webhook_url.webhook_events
|
||||||
|
|
||||||
@webhook_events = @webhook_events.where(status: params[:status]) if %w[success error].include?(params[:status])
|
if %w[success error].include?(params[:status])
|
||||||
|
@webhook_events = @webhook_events.where(WebhookEvent.arel_table[:status].eq(params[:status]))
|
||||||
|
end
|
||||||
|
|
||||||
@pagy, @webhook_events = pagy(:countless, @webhook_events.order(id: :desc))
|
@pagy, @webhook_events = pagy(:countless, @webhook_events.order(id: :desc))
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user