alchemy-json_api 0.7.2 → 0.8.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: 1fe4670c3c86dc4038be27367e22edf73b08771a8821897f7ff09155edeeac2b
4
- data.tar.gz: 6df10ac401188dcc94e927569bc6b9fd1303b19b03a46738e296fd35cdd34619
3
+ metadata.gz: d820e87bf877fa770b6145ca3e2e50b907bb673d917a416723ad13b3edb72158
4
+ data.tar.gz: 907f95e93d6bbe7bcd57e64b768d86ad459dd7fb5fd957692e16eaf251369be0
5
5
  SHA512:
6
- metadata.gz: c537c5b7007113d5da441a755e1f138805782223015e50da29fe7c73476abdbd45b760dcb5088ad1ef2e866435d4439602d0ee71f90ce16c250376b948016b0e
7
- data.tar.gz: '08e1e57a768cbcae7332257f97766175b9bf5b4d8520dd8fa0904d4b296a933154eeb3f0e7d7e0f4ce2dd06641153350d008671cebb3fd072f98d9185c7bb32c'
6
+ metadata.gz: c1119df682cb6a9cb82447da59a3f24afc59c7dad9fb44c65dd8a16dbfdc74826ebab74d65e2b697e2fc7117519d71d8dafc149b71f035f32b7da4be02edce03
7
+ data.tar.gz: 0d83f06aa5aeeaf44712096197324bab31be452196d795504ee2ec0b3d34006de68b41ce20c3ad6a2fff84251d13184a953d165b7cf06b32b9c9df7849f5d24d
data/Rakefile CHANGED
@@ -21,6 +21,7 @@ task :test_setup do
21
21
  export RAILS_ENV=test && \
22
22
  bin/rake db:environment:set db:drop && \
23
23
  bin/rake railties:install:migrations && \
24
+ bin/rails g alchemy:devise:install --force && \
24
25
  bin/rake db:migrate
25
26
  SETUP
26
27
  exit($?.exitstatus) unless $?.success?
@@ -3,6 +3,7 @@ module Alchemy
3
3
  module JsonApi
4
4
  class BaseController < ::ApplicationController
5
5
  include Alchemy::ControllerActions
6
+ include Alchemy::AbilityHelper
6
7
  include JSONAPI::Fetching
7
8
  include JSONAPI::Errors
8
9
  include JSONAPI::Filtering
@@ -46,9 +46,14 @@ module Alchemy
46
46
  end
47
47
 
48
48
  def base_page_scope
49
- ::Alchemy::Page.
49
+ # cancancan is not able to merge our complex AR scopes for logged in users
50
+ if can?(:edit_content, Page)
51
+ pages = Page.all
52
+ else
53
+ pages = Page.accessible_by(current_ability, :index)
54
+ end
55
+ pages.
50
56
  with_language(Language.current).
51
- published.
52
57
  preload(language: {nodes: [:parent, :page]}, all_elements: [:parent_element, :nested_elements, { contents: { essence: :ingredient_association } }])
53
58
  end
54
59
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module Alchemy
3
3
  module JsonApi
4
- VERSION = "0.7.2"
4
+ VERSION = "0.8.0"
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: 0.7.2
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Meyerhoff
@@ -162,7 +162,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
162
  - !ruby/object:Gem::Version
163
163
  version: '0'
164
164
  requirements: []
165
- rubygems_version: 3.0.3
165
+ rubygems_version: 3.1.4
166
166
  signing_key:
167
167
  specification_version: 4
168
168
  summary: A JSONAPI compliant API for AlchemyCMS