Skip to content

Commit

Permalink
Merge pull request #69 from AlchemyCMS/alchemy-7-support
Browse files Browse the repository at this point in the history
Alchemy 7 support: Remove essence serializers
  • Loading branch information
tvdeyen authored Mar 31, 2023
2 parents df7155e + 451b687 commit 75aa2f4
Show file tree
Hide file tree
Showing 39 changed files with 115 additions and 1,115 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/brakeman-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# Customize the ruby version depending on your needs
- name: Set up Ruby
Expand All @@ -39,6 +39,6 @@ jobs:
# Upload the SARIF file generated in the previous step
- name: Upload SARIF
uses: github/codeql-action/upload-sarif@v1
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: output.sarif.json
12 changes: 5 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,23 @@ jobs:
fail-fast: false
matrix:
alchemy_branch:
- 6.0-stable
- 6.1-stable
- main
ruby:
- "2.7"
- "3.0"
- "3.1"
- "3.2"
env:
ALCHEMY_BRANCH: ${{ matrix.alchemy_branch }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Restore apt cache
id: apt-cache
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: /home/runner/apt/cache
key: apt-sqlite-
Expand All @@ -51,9 +49,9 @@ jobs:
env:
NODE_ENV: test
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@v3
- name: Restore node modules cache
uses: actions/cache@v2.1.3
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('./package.json') }}
Expand Down
2 changes: 1 addition & 1 deletion alchemy-json_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Gem::Specification.new do |spec|

spec.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "Rakefile", "README.md"]

spec.add_dependency "alchemy_cms", [">= 6.0.0", "< 7"]
spec.add_dependency "alchemy_cms", [">= 7.0.0.a", "< 8"]
spec.add_dependency "jsonapi.rb", "~> 1.6"

spec.add_development_dependency "factory_bot"
Expand Down
1 change: 0 additions & 1 deletion app/controllers/alchemy/json_api/pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ def page_scope_with_includes
page_version_type => {
elements: [
:nested_elements,
{ contents: { essence: :ingredient_association } },
{ ingredients: :related_object },
],
},
Expand Down
6 changes: 6 additions & 0 deletions app/models/alchemy/json_api/page.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
module Alchemy
# With Ransack 4 we need to define the attributes
# that are allowed to be searched.
def Page.ransackable_attributes(_auth_object = nil)
%w[urlname page_layout]
end

module JsonApi
class Page < SimpleDelegator
attr_reader :page_version_type, :page_version
Expand Down
4 changes: 0 additions & 4 deletions app/serializers/alchemy/json_api/element_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ class ElementSerializer < BaseSerializer
!!element.definition[:deprecated]
end

has_many :essences, polymorphic: true do |element|
element.contents.map(&:essence)
end

has_many :ingredients,
serializer: ->(record) do
"Alchemy::JsonApi::Ingredient#{record.type.demodulize}Serializer".constantize
Expand Down
40 changes: 0 additions & 40 deletions app/serializers/alchemy/json_api/essence_audio_serializer.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/serializers/alchemy/json_api/essence_boolean_serializer.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/serializers/alchemy/json_api/essence_date_serializer.rb

This file was deleted.

32 changes: 0 additions & 32 deletions app/serializers/alchemy/json_api/essence_file_serializer.rb

This file was deleted.

13 changes: 0 additions & 13 deletions app/serializers/alchemy/json_api/essence_headline_serializer.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/serializers/alchemy/json_api/essence_html_serializer.rb

This file was deleted.

14 changes: 0 additions & 14 deletions app/serializers/alchemy/json_api/essence_link_serializer.rb

This file was deleted.

34 changes: 0 additions & 34 deletions app/serializers/alchemy/json_api/essence_node_serializer.rb

This file was deleted.

24 changes: 0 additions & 24 deletions app/serializers/alchemy/json_api/essence_page_serializer.rb

This file was deleted.

78 changes: 0 additions & 78 deletions app/serializers/alchemy/json_api/essence_picture_serializer.rb

This file was deleted.

15 changes: 0 additions & 15 deletions app/serializers/alchemy/json_api/essence_richtext_serializer.rb

This file was deleted.

10 changes: 0 additions & 10 deletions app/serializers/alchemy/json_api/essence_select_serializer.rb

This file was deleted.

Loading

0 comments on commit 75aa2f4

Please sign in to comment.