Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecations #1656

Merged
merged 13 commits into from
Oct 24, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove deprecated second argument from Page.find_elements
tvdeyen committed Oct 23, 2019

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit a9ea776e1bd25d0f58c52193c1e3efb77b9b9f4e
8 changes: 1 addition & 7 deletions app/models/alchemy/page.rb
Original file line number Diff line number Diff line change
@@ -310,13 +310,7 @@ def new_name_for_copy(custom_name, source_name)
# Use this for your custom element loading logic.
#
# @return [ActiveRecord::Relation]
def find_elements(options = {}, show_non_public = false)
if show_non_public
Alchemy::Deprecation.warn "Passing true as second argument to page#find_elements to include" \
" invisible elements has been removed. Please implement your own ElementsFinder" \
" and pass it with options[:finder]."
end

def find_elements(options = {})
finder = options[:finder] || Alchemy::ElementsFinder.new(options)
finder.elements(page: self)
end
9 changes: 0 additions & 9 deletions spec/models/alchemy/page_spec.rb
Original file line number Diff line number Diff line change
@@ -1166,15 +1166,6 @@ module Alchemy
expect(subject.map(&:name)).to eq(['news'])
end
end

context 'with second argument set to true' do
subject { page.find_elements(options, true) }

it 'warns about removal of second argument' do
expect(Alchemy::Deprecation).to receive(:warn)
subject
end
end
end

describe '#first_public_child' do