Skip to content

Commit

Permalink
Do not use has_controller? method
Browse files Browse the repository at this point in the history
This method has been deprecated and we do not want to use it
internally to avoid loggin deprecation warnings.
  • Loading branch information
tvdeyen committed Feb 25, 2020
1 parent 15e0880 commit 80656d3
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/concerns/alchemy/page_redirects.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def public_child_redirect_url
end

def controller_and_action_url
return unless @page.has_controller?
return unless @page.definition['controller']

main_app.url_for(@page.controller_and_action)
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/alchemy/page/page_natures.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def locked?

# @deprecated Please use a menu node with an url pointing to your controller path instead.
def controller_and_action
if has_controller?
if definition['controller']
{
controller: definition["controller"].gsub(/(^\b)/, "/#{$1}"),
action: definition["action"]
Expand Down
1 change: 0 additions & 1 deletion spec/models/alchemy/page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2211,7 +2211,6 @@ module Alchemy

context 'if the page has a custom controller defined in its definition' do
before do
allow(page).to receive(:has_controller?).and_return(true)
allow(page).to receive(:definition).and_return({'controller' => 'comments', 'action' => 'index'})
end
it "should return a Hash with controller and action key-value pairs" do
Expand Down

0 comments on commit 80656d3

Please sign in to comment.