Module: Ecm::Galleries::PictureGallery::PictureDetails

Extended by:
ActiveSupport::Concern
Included in:
Ecm::Galleries::PictureGallery
Defined in:
app/models/ecm/galleries/picture_gallery.rb

Instance Method Summary collapse

Instance Method Details

#append_assetsObject



20
21
22
# File 'app/models/ecm/galleries/picture_gallery.rb', line 20

def append_assets
  assets
end

#append_assets=(assets) ⇒ Object



24
25
26
# File 'app/models/ecm/galleries/picture_gallery.rb', line 24

def append_assets=(assets)
  self.assets = assets
end

#overwrite_assetsObject



28
29
30
# File 'app/models/ecm/galleries/picture_gallery.rb', line 28

def overwrite_assets
  assets
end

#overwrite_assets=(assets) ⇒ Object



32
33
34
35
36
# File 'app/models/ecm/galleries/picture_gallery.rb', line 32

def overwrite_assets=(assets)
  return if assets.nil? || assets.empty?
  self.picture_details.map { |pd| pd.mark_for_destruction }
  self.assets = assets
end

#picture_details_countObject



38
39
40
# File 'app/models/ecm/galleries/picture_gallery.rb', line 38

def picture_details_count
  picture_details.count
end