Skip to content

Commit e9b8752

Browse files
committed
Provide a service attribute in page definition
The service can be any class that is callable and that is inheriting the service structure of Alchemy::BasePageService.
1 parent 9d63af9 commit e9b8752

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

app/models/alchemy/page_definition.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class PageDefinition
2020
attribute :hide, :boolean, default: false
2121
attribute :editable_by
2222
attribute :hint
23+
attribute :service, Alchemy::PageServiceType.new
2324

2425
# Needs to be down here in order to have the attribute reader
2526
# available after the attribute is defined.

spec/models/alchemy/page_definition_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ module Alchemy
2020
it { is_expected.to have_key(:hide) }
2121
it { is_expected.to have_key(:editable_by) }
2222
it { is_expected.to have_key(:hint) }
23+
it { is_expected.to have_key(:service) }
2324
end
2425

2526
describe "#blank?" do

0 commit comments

Comments
 (0)