Sha256: 633afb03f2ddd83f6c64e04ea829839544ed5f09cfac6ae3d610524b2ddea081
Contents?: true
Size: 1.01 KB
Versions: 19
Compression:
Stored size: 1.01 KB
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 deprecate :index, deprecator: Alchemy::Deprecation def clear @page = Page.find(params[:page_id]) @elements = Element.trashed @elements.map(&:destroy) end deprecate :clear, deprecator: Alchemy::Deprecation private def element_includes [ { contents: { essence: :ingredient_association, }, all_nested_elements: [ { contents: { essence: :ingredient_association, }, }, ], }, ] end end end end
Version data entries
19 entries across 19 versions & 1 rubygems