Skip to content

Commit

Permalink
Fix a bug where default languages where added every time person was v…
Browse files Browse the repository at this point in the history
…isited
  • Loading branch information
RandomTannenbaum committed Jul 31, 2024
1 parent f5c5af3 commit 684816e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/models/person.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,10 @@ def picture_size
end

def set_default_languages
%w[DE EN FR].each do |language|
language_skills.push(LanguageSkill.new({ language: language, level: 'A1' }))
if new_record?
%w[DE EN FR].each do |language|
language_skills.push(LanguageSkill.new({ language: language, level: 'Keine' }))
end
end
end
end

0 comments on commit 684816e

Please sign in to comment.