Class: Pageflow::SiteRootEntryForm Private
- Inherits:
-
Object
- Object
- Pageflow::SiteRootEntryForm
- Includes:
- ActiveModel::Model
- Defined in:
- app/models/pageflow/site_root_entry_form.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #entry_id ⇒ Object private
Instance Method Summary collapse
- #entry ⇒ Object private
-
#initialize(attributes, site) ⇒ SiteRootEntryForm
constructor
private
A new instance of SiteRootEntryForm.
- #save ⇒ Object private
Constructor Details
#initialize(attributes, site) ⇒ SiteRootEntryForm
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of SiteRootEntryForm.
10 11 12 13 |
# File 'app/models/pageflow/site_root_entry_form.rb', line 10 def initialize(attributes, site) super(attributes) @site = site end |
Instance Attribute Details
#entry_id ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 |
# File 'app/models/pageflow/site_root_entry_form.rb', line 6 def entry_id @entry_id end |
Instance Method Details
#entry ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'app/models/pageflow/site_root_entry_form.rb', line 23 def entry @entry ||= @site.entries.find_by_id(entry_id) end |
#save ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 18 19 20 21 |
# File 'app/models/pageflow/site_root_entry_form.rb', line 15 def save return false unless valid? entry.permalink.update(allow_root_path: true, directory: @site.permalink_directories.find_by_path(''), slug: '') end |