alchemy-json_api 2.2.0 → 2.4.0

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: 998909ab79b771f8adf243e5aa3878116ff30b0292990676f2e3e66c9bcf7df4
4
- data.tar.gz: 5981655e53fbd3af1d1d70260122db353b3f0cbf81622bb7ac2f891f6fcc3fdc
3
+ metadata.gz: 25545f5154bcb25d830d0f5ed72484919b15d6ba42f62fb4ae80dd89a2e9bfab
4
+ data.tar.gz: d1de54c872b65a18a19787a35338a83370cf4eb0ee27449f18052e5559e34c0f
5
5
  SHA512:
6
- metadata.gz: 372fe15209e5eb39a767d40914cbe2bf77b4a7014e7db764bccf762206e019772d7fa9833fec19df80245b078acf2ee483e064829e37b824da613ff0dba68e6a
7
- data.tar.gz: 3ee1be6b2024a95645d15aa4d98e6882fd356a31ca96263128a5ef9ac75aedd88679852816368f7988932550d906ac7fcdc5c821b51878c12f10cf096a222270
6
+ metadata.gz: 6ce326a8d3722174dc8b35f5942e1d2a9f57dd54db90f469a2f2748e3c57aa4fe2bf81227c9cd4a3533d0de0d7a887dc6d17bfea4457497389ce9c110dd69df1
7
+ data.tar.gz: 14ac73e84ab0ffaf277f966d18e3c7c742873379d3638def3c8f954e6cac926d70d9160d78a4d339be5dde289396f148df169d95518c57bb60c70df443708486
@@ -26,7 +26,7 @@ module Alchemy
26
26
  logger = Rails.logger
27
27
  return unless logger
28
28
 
29
- message = +"\n#{exception.class} (#{exception.message}):\n"
29
+ message = "\n#{exception.class} (#{exception.message}):\n"
30
30
  message << exception.annotated_source_code.to_s if exception.respond_to?(:annotated_source_code)
31
31
  message << " " << exception.backtrace.join("\n ")
32
32
  logger.fatal("#{message}\n\n")
@@ -15,7 +15,8 @@ module Alchemy
15
15
  :meta_keywords,
16
16
  :meta_description,
17
17
  :created_at,
18
- :updated_at
18
+ :updated_at,
19
+ :restricted
19
20
  )
20
21
 
21
22
  cache_options store: Rails.cache, namespace: "alchemy-jsonapi"
@@ -4,8 +4,6 @@ module Alchemy
4
4
  module JsonApi
5
5
  module IngredientSerializer
6
6
  def self.included(klass)
7
- klass.has_one :element, record_type: :element, serializer: ::Alchemy::JsonApi::ElementSerializer
8
-
9
7
  klass.attributes(
10
8
  :role,
11
9
  :value,
@@ -26,12 +26,4 @@ RSpec.shared_examples "an ingredient serializer" do
26
26
  end
27
27
  end
28
28
  end
29
-
30
- describe "relationships" do
31
- subject { serializer.serializable_hash[:data][:relationships] }
32
-
33
- it "has one element" do
34
- expect(subject[:element]).to eq(data: {id: ingredient.element_id.to_s, type: :element})
35
- end
36
- end
37
29
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Alchemy
4
4
  module JsonApi
5
- VERSION = "2.2.0"
5
+ VERSION = "2.4.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alchemy-json_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Meyerhoff
8
8
  - Thomas von Deyen
9
- autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2024-05-16 00:00:00.000000000 Z
11
+ date: 2025-01-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: alchemy_cms
@@ -40,7 +39,7 @@ dependencies:
40
39
  version: 1.6.0
41
40
  - - "<"
42
41
  - !ruby/object:Gem::Version
43
- version: '2.1'
42
+ version: '2.2'
44
43
  type: :runtime
45
44
  prerelease: false
46
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -50,7 +49,7 @@ dependencies:
50
49
  version: 1.6.0
51
50
  - - "<"
52
51
  - !ruby/object:Gem::Version
53
- version: '2.1'
52
+ version: '2.2'
54
53
  - !ruby/object:Gem::Dependency
55
54
  name: factory_bot
56
55
  requirement: !ruby/object:Gem::Requirement
@@ -160,9 +159,7 @@ files:
160
159
  - config/routes.rb
161
160
  - lib/alchemy/json_api.rb
162
161
  - lib/alchemy/json_api/engine.rb
163
- - lib/alchemy/json_api/essence_serializer.rb
164
162
  - lib/alchemy/json_api/ingredient_serializer.rb
165
- - lib/alchemy/json_api/test_support/essence_serializer_behaviour.rb
166
163
  - lib/alchemy/json_api/test_support/ingredient_serializer_behaviour.rb
167
164
  - lib/alchemy/json_api/version.rb
168
165
  - lib/tasks/alchemy/json_api_tasks.rake
@@ -170,7 +167,6 @@ homepage: https://github.com/AlchemyCMS/alchemy-json_api
170
167
  licenses:
171
168
  - BSD-3-Clause
172
169
  metadata: {}
173
- post_install_message:
174
170
  rdoc_options: []
175
171
  require_paths:
176
172
  - lib
@@ -185,8 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
181
  - !ruby/object:Gem::Version
186
182
  version: '0'
187
183
  requirements: []
188
- rubygems_version: 3.5.9
189
- signing_key:
184
+ rubygems_version: 3.6.2
190
185
  specification_version: 4
191
186
  summary: A JSONAPI compliant API for AlchemyCMS
192
187
  test_files: []
@@ -1,20 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Alchemy
4
- module JsonApi
5
- module EssenceSerializer
6
- def self.included(klass)
7
- klass.has_one :element, record_type: :element, serializer: ::Alchemy::JsonApi::ElementSerializer do |essence|
8
- essence.content.element
9
- end
10
- klass.attributes :ingredient
11
- klass.attribute :role do |essence|
12
- essence.content.name
13
- end
14
- klass.attribute :deprecated do |essence|
15
- !!essence.content.definition[:deprecated]
16
- end
17
- end
18
- end
19
- end
20
- end
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RSpec.shared_examples "an essence serializer" do
4
- describe "attributes" do
5
- subject { serializer.serializable_hash[:data][:attributes] }
6
-
7
- it "has the right keys and values" do
8
- expect(subject).to have_key(:ingredient)
9
- expect(subject[:deprecated]).to be(false)
10
- end
11
-
12
- context "a deprecated content" do
13
- let(:content) { FactoryBot.create(:alchemy_content, name: "intro", element: element) }
14
-
15
- before do
16
- expect(content).to receive(:definition).at_least(:once) do
17
- {
18
- name: "intro",
19
- deprecated: true
20
- }
21
- end
22
- end
23
-
24
- it "has deprecated attribute set to true" do
25
- expect(subject[:deprecated]).to eq(true)
26
- end
27
- end
28
- end
29
-
30
- describe "relationships" do
31
- subject { serializer.serializable_hash[:data][:relationships] }
32
-
33
- it "has the right keys and values" do
34
- expect(subject[:element]).to eq(data: {id: essence.element.id.to_s, type: :element})
35
- end
36
- end
37
- end