Sha256: b98adfe91e27d8ead58b0a9a24a7e971751c96a0545d85a613d5b8c940c25927
Contents?: true
Size: 779 Bytes
Versions: 87
Compression:
Stored size: 779 Bytes
Contents
module Pageflow class FileReuse attr_accessor :source_entry, :destination_entry, :file_type, :file def initialize(destination_entry, source_entry, file_type, file_id) @source_entry = source_entry @destination_entry = destination_entry @file_type = file_type @file = source_entry.find_file(file_type.model, file_id) end def save! destination_entry.use_file(file) file_type.nested_file_types.each do |nested_file_type| source_entry.find_files(nested_file_type.model).each do |nested_file| next if nested_file.parent_file_id != file.id || nested_file.parent_file_model_type != file.model_name.name destination_entry.use_file(nested_file) end end end end end
Version data entries
87 entries across 87 versions & 1 rubygems