fix sqlite query

pull/502/head
Pete Matsyburka 4 months ago
parent 48e73c2c81
commit 33b14d5278

@ -55,10 +55,8 @@ class TemplatesDashboardController < ApplicationController
rel = Template.where(
Template.arel_table[:id].in(
Arel::Nodes::Union.new(
rel.where(folder_id: current_account.default_template_folder.id).select(:id).arel,
shared_template_ids.arel
)
rel.where(folder_id: current_account.default_template_folder.id).select(:id).arel
.union(shared_template_ids.arel)
)
)
else

@ -13,7 +13,7 @@ module Abilities
TemplateSharing.where({ ability:, account_id: [user.account_id, TemplateSharing::ALL_ID] }.compact)
.select(:template_id)
Template.where(Template.arel_table[:id].in(Arel::Nodes::Union.new(templates.select(:id).arel, shared_ids.arel)))
Template.where(Template.arel_table[:id].in(templates.select(:id).arel.union(shared_ids.arel)))
end
def entity(template, user:, ability: nil)

Loading…
Cancel
Save