-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: transition from Virtus to dry-transaction for Service Layer…
…, migrate Media Widget Parser to Plugins::Core, remove RSS logic, remove various non-core logic, various refactors
- Loading branch information
1 parent
fa7f6b6
commit 25eaf20
Showing
37 changed files
with
253 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# TODO: ContentTypes, Decorators or Contracts themselves should inform the system what the correct Decorator is, not a hardcoded concern method | ||
module Cortex | ||
module Decoratable | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
def index_decorator(content_type) | ||
content_type.decorators.find_by_name('Index') | ||
end | ||
|
||
def wizard_decorator(content_type) | ||
content_type.decorators.find_by_name('Wizard') | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,24 +32,10 @@ class ContentItem < Cortex::ApplicationRecord | |
end | ||
|
||
def publish_state | ||
# TODO: move logic to Transaction | ||
PublishStateService.new.content_item_state(self) | ||
end | ||
|
||
def rss_url(base_url, slug_field_id) # TODO: abstract RSS to separate app once API is implemented | ||
slug = field_items.find_by_field_id(slug_field_id).data.values.join | ||
"#{base_url}#{slug}" | ||
end | ||
|
||
def rss_date(date_field_id) # TODO: abstract RSS to separate app once API is implemented | ||
date = field_items.find_by_field_id(date_field_id).data["timestamp"] | ||
Date.parse(date).rfc2822 | ||
end | ||
|
||
def rss_author(field_id) # TODO: abstract RSS to separate app once API is implemented | ||
author = field_items.find_by_field_id(field_id).data["author_name"] | ||
"[email protected] (#{author})" | ||
end | ||
|
||
# FieldItem and State Convenience Methods. TODO: move to concern? transactions? | ||
def method_missing(method_name, *arguments, &block) | ||
super unless dynamic_method?(method_name) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.