This should be `if edition.allows_attachments? && edition.persisted?` and the `if edition.persisted?` on line 179 should be removed.