def add_child(role, &block)
      attachment = self.children.build
      attachment.role = role
      attachment.owner = self.owner
      attachment.file_name = self.file_name
      attachment.file_type = self.file_type
      attachment.disposition = self.disposition
      attachment.cache_type = self.cache_type
      attachment.cache_max_age = self.cache_max_age
      attachment.type = self.type
      block.call(attachment)
      attachment.save!
    end
def add_child(role, &block)
      attachment = self.children.build
      attachment.role = role
      attachment.owner = self.owner
      attachment.file_name = self.file_name
      attachment.file_type = self.file_type
      attachment.disposition = self.disposition
      attachment.cache_type = self.cache_type
      attachment.cache_max_age = self.cache_max_age
      attachment.type = self.type
      block.call(attachment)
      attachment.save!
    end
Add a child attachment