diff --git a/app/models/additionals_journal.rb b/app/models/additionals_journal.rb index 4a5359ce..e1ef01ce 100644 --- a/app/models/additionals_journal.rb +++ b/app/models/additionals_journal.rb @@ -27,8 +27,8 @@ def save_journal_history(journal, prop_key, ids_old, ids) end def validate_relation(entries, entry_id) - old_entries = entries.select { |entry| entry.id.present? } - new_entries = entries.select { |entry| entry.id.blank? } + old_entries = entries.select(&:persisted?) + new_entries = entries.select(&:new_record?) return true if new_entries.blank? new_entries.map! { |entry| entry.send entry_id }