diff --git a/app/models/alchemy/page/page_scopes.rb b/app/models/alchemy/page/page_scopes.rb index 1936e6430f..d05e2d7d2c 100644 --- a/app/models/alchemy/page/page_scopes.rb +++ b/app/models/alchemy/page/page_scopes.rb @@ -122,6 +122,10 @@ def not_public(time = Time.current) ) SQL end + + def ransackable_scopes(_auth_object) + [:published, :from_current_site, :searchables, :layoutpages] + end end end end diff --git a/spec/models/alchemy/page_spec.rb b/spec/models/alchemy/page_spec.rb index 2b0159120c..f48210264d 100644 --- a/spec/models/alchemy/page_spec.rb +++ b/spec/models/alchemy/page_spec.rb @@ -695,6 +695,14 @@ class AnotherUrlPathClass; end expect(subject.collect { |e| e["name"] }).not_to include("unique_headline") end end + + describe ".ransackable_scopes" do + let(:auth_object) { double } + + subject { described_class.ransackable_scopes(auth_object) } + + it { is_expected.to match_array([:published, :from_current_site, :layoutpages, :searchables]) } + end end describe "#available_elements_within_current_scope" do