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 +4 -4
- data/app/controllers/alchemy/json_api/base_controller.rb +1 -1
- data/app/serializers/alchemy/json_api/page_serializer.rb +2 -1
- data/lib/alchemy/json_api/ingredient_serializer.rb +0 -2
- data/lib/alchemy/json_api/test_support/ingredient_serializer_behaviour.rb +0 -8
- data/lib/alchemy/json_api/version.rb +1 -1
- metadata +5 -10
- data/lib/alchemy/json_api/essence_serializer.rb +0 -20
- data/lib/alchemy/json_api/test_support/essence_serializer_behaviour.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25545f5154bcb25d830d0f5ed72484919b15d6ba42f62fb4ae80dd89a2e9bfab
|
4
|
+
data.tar.gz: d1de54c872b65a18a19787a35338a83370cf4eb0ee27449f18052e5559e34c0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 =
|
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")
|
@@ -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
|
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.
|
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:
|
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.
|
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.
|
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.
|
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
|