Class: Spina::ImageCollection

Inherits:
ApplicationRecord show all
Includes:
ImageCollectable
Defined in:
app/models/spina/image_collection.rb

Instance Method Summary collapse

Methods included from ImageCollectable

#image_positions=, #image_tokens=

Instance Method Details

#contentObject



12
13
14
# File 'app/models/spina/image_collection.rb', line 12

def content
  self
end

#old_updateObject



16
# File 'app/models/spina/image_collection.rb', line 16

alias_method :old_update, :update

#update(attributes) ⇒ Object



17
18
19
20
# File 'app/models/spina/image_collection.rb', line 17

def update(attributes)
  self.images.clear if attributes.reject{|key,value| key == "id" }.blank?
  old_update(attributes)
end