Skip to content

Commit

Permalink
Deprecate frontend elements controller
Browse files Browse the repository at this point in the history
This is a very old feature that very likely nobody uses.
Will be removed in Alchemy 8.0
  • Loading branch information
tvdeyen committed Jan 5, 2025
1 parent ce12a5d commit c79de61
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/alchemy/elements_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ class ElementsController < Alchemy::BaseController
# * html
# * js (Tries to replace a given +container_id+ with the elements view partial content via jQuery.)
#
# @deprecated This controller action will be removed in Alchemy 8.0.
def show
Alchemy::Deprecation.warn "The elements#show controller action is deprecated and will be removed in Alchemy 8.0."

@page = @element.page
@options = params[:options]

Expand Down
6 changes: 6 additions & 0 deletions spec/controllers/alchemy/elements_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ module Alchemy
let(:restricted_page) { create(:alchemy_page, :public, restricted: true) }
let(:restricted_element) { create(:alchemy_element, page: restricted_page, name: "download") }

around do |example|
Deprecation.silence do
example.run
end
end

describe "#show" do
it "should render available elements" do
get :show, params: {id: element.id}
Expand Down

0 comments on commit c79de61

Please sign in to comment.