Sha256: b425bef4e67f2af2392dddcb06cc0e8da018c84c1205128680469b7fafb287e6
Contents?: true
Size: 589 Bytes
Versions: 6
Compression:
Stored size: 589 Bytes
Contents
module Spina class ImageCollection < ApplicationRecord include ImageCollectable has_one :page_part, as: :page_partable has_many :image_collections_images, autosave: true has_many :images, through: :image_collections_images has_many :structure_parts, as: :structure_partable accepts_nested_attributes_for :images, allow_destroy: true def content self end alias_method :old_update, :update def update(attributes) self.images.clear if attributes.reject{|key,value| key == "id" }.blank? old_update(attributes) end end end
Version data entries
6 entries across 6 versions & 1 rubygems