Skip to content

Commit

Permalink
use persisend and new_record in vaildate_relation
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandermeindl committed Nov 30, 2023
1 parent 712f5b2 commit 8db76df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/additionals_journal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down

0 comments on commit 8db76df

Please sign in to comment.