fix(revision): changed? conflicts with rails method
This commit is contained in:
parent
e6a942a5fc
commit
c1cb89bb44
3 changed files with 3 additions and 3 deletions
|
@ -373,7 +373,7 @@ class Procedure < ApplicationRecord
|
|||
end
|
||||
|
||||
def draft_changed?
|
||||
publiee? && published_revision.changed?(draft_revision) && revision_changes.present?
|
||||
publiee? && published_revision.different_from?(draft_revision) && revision_changes.present?
|
||||
end
|
||||
|
||||
def revision_changes
|
||||
|
|
|
@ -105,7 +105,7 @@ class ProcedureRevision < ApplicationRecord
|
|||
!draft?
|
||||
end
|
||||
|
||||
def changed?(revision)
|
||||
def different_from?(revision)
|
||||
types_de_champ != revision.types_de_champ || types_de_champ_private != revision.types_de_champ_private
|
||||
end
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ describe ProcedureRevision do
|
|||
expect(new_revision.revision_types_de_champ.last.position).to eq(2)
|
||||
expect(new_revision.revision_types_de_champ.last.type_de_champ).to eq(new_type_de_champ)
|
||||
expect(new_revision.revision_types_de_champ.last.type_de_champ.revision).to eq(new_revision)
|
||||
expect(procedure.active_revision.changed?(new_revision)).to be_truthy
|
||||
expect(procedure.active_revision.different_from?(new_revision)).to be_truthy
|
||||
expect(procedure.active_revision.compare(new_revision)).to eq([
|
||||
{
|
||||
op: :add,
|
||||
|
|
Loading…
Reference in a new issue