alchemy-json_api 0.9.0 → 0.9.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edb472c33e158bda23963966813783a459044d61d268a5ba57a45591584f7f2a
|
4
|
+
data.tar.gz: 73ebfd2b1fd491c217cfb577bc422fa558cad73f1c39c987aaac694766de6fee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8393412853b2a72ee6d997cd57d208cfaeab3b9c351aa6c7a4374f7bafd322cbfa9d45d4fb1c9326e7908f1799d741d2f8365e8a85e37412f2efb8b39d040dbb
|
7
|
+
data.tar.gz: 692729353563f43124fafc2d239d4fcf204f897509953211598e6e15f8a5c6d85b8468be874dc52570bb72c80cb7f4b595fc451cca399e3e8c26893ef645e720
|
@@ -42,19 +42,22 @@ module Alchemy
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def page_scope
|
45
|
-
|
45
|
+
page_scope_with_includes.contentpages
|
46
|
+
end
|
47
|
+
|
48
|
+
def page_scope_with_includes
|
49
|
+
base_page_scope.
|
50
|
+
with_language(Language.current).
|
51
|
+
preload(language: {nodes: [:parent, :page]}, all_elements: [:parent_element, :nested_elements, { contents: { essence: :ingredient_association } }])
|
46
52
|
end
|
47
53
|
|
48
54
|
def base_page_scope
|
49
55
|
# cancancan is not able to merge our complex AR scopes for logged in users
|
50
56
|
if can?(:edit_content, Page)
|
51
|
-
|
57
|
+
Page.all
|
52
58
|
else
|
53
|
-
|
59
|
+
Page.published
|
54
60
|
end
|
55
|
-
pages.
|
56
|
-
with_language(Language.current).
|
57
|
-
preload(language: {nodes: [:parent, :page]}, all_elements: [:parent_element, :nested_elements, { contents: { essence: :ingredient_association } }])
|
58
61
|
end
|
59
62
|
|
60
63
|
def jsonapi_serializer_class(_resource, _is_collection)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alchemy-json_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Meyerhoff
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: alchemy_cms
|