Method: Pageflow::FileReuse#save!

Defined in:
app/models/pageflow/file_reuse.rb

#save!Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/models/pageflow/file_reuse.rb', line 12

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