Module: PagesCore::PageModel::Attachments
- Extended by:
- ActiveSupport::Concern
- Included in:
- Page
- Defined in:
- app/models/concerns/pages_core/page_model/attachments.rb
Instance Method Summary collapse
- #attachments ⇒ Object
- #attachments? ⇒ Boolean
- #files ⇒ Object
- #page_files ⇒ Object
- #page_files_attributes=(attrs) ⇒ Object
Instance Method Details
#attachments ⇒ Object
24 25 26 |
# File 'app/models/concerns/pages_core/page_model/attachments.rb', line 24 def super.in_locale(locale) end |
#attachments? ⇒ Boolean
28 29 30 |
# File 'app/models/concerns/pages_core/page_model/attachments.rb', line 28 def .any? end |
#files ⇒ Object
41 42 43 |
# File 'app/models/concerns/pages_core/page_model/attachments.rb', line 41 def files page_files end |
#page_files ⇒ Object
32 33 34 |
# File 'app/models/concerns/pages_core/page_model/attachments.rb', line 32 def page_files super.in_locale(locale) end |
#page_files_attributes=(attrs) ⇒ Object
36 37 38 39 |
# File 'app/models/concerns/pages_core/page_model/attachments.rb', line 36 def page_files_attributes=(attrs) ids = page_files.map(&:id) super(attrs.reject { |a| a["_destroy"] && ids.exclude?(a["id"]) }) end |