Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 0 additions & 6 deletions app/models/alchemy/json_api/page.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
module Alchemy
# With Ransack 4 we need to define the attributes
# that are allowed to be searched.
def Page.ransackable_attributes(_auth_object = nil)
super | %w[page_layout]
end

module JsonApi
class Page < SimpleDelegator
attr_reader :page_version_type, :page_version
Expand Down
11 changes: 11 additions & 0 deletions spec/models/alchemy/page_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require "rails_helper"

RSpec.describe Alchemy::Page, type: :model do
describe ".ransackable_attributes" do
let(:auth_object) { double }

subject { described_class.ransackable_attributes(auth_object) }

it { is_expected.to include("page_layout") }
end
end
Loading