Class: Pulitzer::DestroyPostTypeFreeFormSections
- Inherits:
-
Object
- Object
- Pulitzer::DestroyPostTypeFreeFormSections
- Defined in:
- app/interactions/pulitzer/destroy_post_type_free_form_sections.rb
Instance Attribute Summary collapse
-
#ffst ⇒ Object
Returns the value of attribute ffst.
-
#post_type ⇒ Object
Returns the value of attribute post_type.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(ffst) ⇒ DestroyPostTypeFreeFormSections
constructor
A new instance of DestroyPostTypeFreeFormSections.
Constructor Details
#initialize(ffst) ⇒ DestroyPostTypeFreeFormSections
Returns a new instance of DestroyPostTypeFreeFormSections.
4 5 6 7 |
# File 'app/interactions/pulitzer/destroy_post_type_free_form_sections.rb', line 4 def initialize(ffst) self.post_type = ffst.post_type self.ffst = ffst end |
Instance Attribute Details
#ffst ⇒ Object
Returns the value of attribute ffst.
2 3 4 |
# File 'app/interactions/pulitzer/destroy_post_type_free_form_sections.rb', line 2 def ffst @ffst end |
#post_type ⇒ Object
Returns the value of attribute post_type.
2 3 4 |
# File 'app/interactions/pulitzer/destroy_post_type_free_form_sections.rb', line 2 def post_type @post_type end |
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 15 |
# File 'app/interactions/pulitzer/destroy_post_type_free_form_sections.rb', line 9 def call post_type.posts.each do |post| post.preview_version.free_form_sections.where(free_form_section_type_id: ffst.id).each do |ffs| ffs.destroy end end end |