Sha256: 60d7214298a0f2470fbda07d1cc1ee9da06faf5f20490888f6a2c184e40fd719
Contents?: true
Size: 921 Bytes
Versions: 29
Compression:
Stored size: 921 Bytes
Contents
# frozen_string_literal: true module Alchemy module Admin class TrashController < Alchemy::Admin::BaseController helper "alchemy/admin/elements" authorize_resource class: false def index @elements = Element.trashed.includes(*element_includes) @page = Page.find(params[:page_id]) @allowed_elements = @page.available_element_definitions end def clear @page = Page.find(params[:page_id]) @elements = Element.trashed @elements.map(&:destroy) end private def element_includes [ { contents: { essence: :ingredient_association, }, all_nested_elements: [ { contents: { essence: :ingredient_association, }, }, ], }, ] end end end end
Version data entries
29 entries across 29 versions & 1 rubygems