alchemy-json_api 2.0.0 → 2.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 529c7f7ab8ebaaf065cfdaf1e25441ef1453c5e179a10cd6e40caefdbbe58f1a
4
- data.tar.gz: 6761266d21e3d9bba7678f86edc9f8372850845880ec8030c98d91d74752f8cd
3
+ metadata.gz: e4da501de3e83d19a9226ed5cba95c5ee4026c0931997070daaa55aabc4357c3
4
+ data.tar.gz: 7a4c15a0d2186d2a3b62badf8817ccc2f16ffc4bd8fcea8dc2b88adfc2099b16
5
5
  SHA512:
6
- metadata.gz: 8335a8178b3ffdffa04a7b4c637248387cf3b625d7e7b6db7ce02fc95faf456fd61a7ebd052af1c96accb5fce206e6c005c69a365c871ac5707b86a64fa37902
7
- data.tar.gz: ed1ee154159e7b67262999db7539791b1b904ab860846042421a4f2e04a1e8f21643096adb9d5ddf478f73572da699323192628b204fdfd5cb523973175c4398
6
+ metadata.gz: 19a29387ac8c5e087bb1ad8f04e162af62c4f0c05f6481d3579fa0b415dca569517c7a3e5a763c17aff0d3f6fe0cb1bda913156b7be3b51900724af3f713516a
7
+ data.tar.gz: 7800110a1df4d98a6e96184420316be08ba8c43a25690ce6f6a29f29191505055f344cf0f80523e06221796a344f4b58bd4a1da169fc1dc2da4a384ef3085817
@@ -6,7 +6,7 @@ module Alchemy
6
6
  before_action :load_page_for_cache_key, only: :show
7
7
 
8
8
  def index
9
- allowed = [:page_layout, :urlname]
9
+ allowed = Alchemy::Page.ransackable_attributes
10
10
 
11
11
  jsonapi_filter(page_scope, allowed) do |filtered_pages|
12
12
  @pages = filtered_pages.result
@@ -79,6 +79,7 @@ module Alchemy
79
79
 
80
80
  def load_page_by_id
81
81
  return unless params[:path] =~ /\A\d+\z/
82
+
82
83
  page_scope_with_includes.find_by(id: params[:path])
83
84
  end
84
85
 
@@ -104,7 +105,7 @@ module Alchemy
104
105
  ],
105
106
  },
106
107
  },
107
- ]
108
+ ],
108
109
  )
109
110
  end
110
111
 
@@ -2,7 +2,7 @@ module Alchemy
2
2
  # With Ransack 4 we need to define the attributes
3
3
  # that are allowed to be searched.
4
4
  def Page.ransackable_attributes(_auth_object = nil)
5
- %w[urlname page_layout]
5
+ super | %w[page_layout]
6
6
  end
7
7
 
8
8
  module JsonApi
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Alchemy
3
3
  module JsonApi
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-json_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Meyerhoff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-31 00:00:00.000000000 Z
12
+ date: 2023-07-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: alchemy_cms
@@ -179,7 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  - !ruby/object:Gem::Version
180
180
  version: '0'
181
181
  requirements: []
182
- rubygems_version: 3.4.6
182
+ rubygems_version: 3.4.15
183
183
  signing_key:
184
184
  specification_version: 4
185
185
  summary: A JSONAPI compliant API for AlchemyCMS