Skip to content

Commit

Permalink
Fix conflicted field on version new operation
Browse files Browse the repository at this point in the history
  • Loading branch information
simonprev committed Dec 12, 2023
1 parent bcab452 commit 12864e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/movement/migration/translation.ex
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ defmodule Movement.Migration.Translation do
key: operation.key,
proposed_text: operation.text,
corrected_text: operation.text,
conflicted: false,
conflicted: operation.previous_translation && operation.previous_translation.conflicted,
value_type: operation.value_type,
file_index: operation.file_index,
file_comment: operation.file_comment,
Expand All @@ -99,7 +99,6 @@ defmodule Movement.Migration.Translation do
:action,
:key,
:text,
:conflicted,
:value_type,
:plural,
:locked,
Expand Down
5 changes: 5 additions & 0 deletions test/movement/persisters/new_version_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ defmodule AccentTest.Movement.Persisters.NewVersion do
file_comment: "comment",
plural: true,
locked: true,
conflicted: true,
revision_id: revision.id,
document_id: document.id
})
Expand All @@ -59,6 +60,9 @@ defmodule AccentTest.Movement.Persisters.NewVersion do
text: "B",
translation_id: translation.id,
value_type: "string",
previous_translation: %Accent.PreviousTranslation{
conflicted: translation.conflicted
},
revision_id: revision.id,
placeholders: []
}
Expand Down Expand Up @@ -91,5 +95,6 @@ defmodule AccentTest.Movement.Persisters.NewVersion do
assert version_translation.key === "a"
assert version_translation.proposed_text === "B"
assert version_translation.value_type === "string"
assert version_translation.conflicted
end
end

0 comments on commit 12864e9

Please sign in to comment.