review: prefer if to unless
Co-authored-by: LeSim <mail@simon.lehericey.net>
This commit is contained in:
parent
006a1257b5
commit
9dfb498806
1 changed files with 1 additions and 1 deletions
|
@ -4,7 +4,7 @@ module DossierPrefillableConcern
|
||||||
extend ActiveSupport::Concern
|
extend ActiveSupport::Concern
|
||||||
|
|
||||||
def prefill!(champs_public_attributes)
|
def prefill!(champs_public_attributes)
|
||||||
return unless champs_public_attributes.any?
|
return if champs_public_attributes.empty?
|
||||||
|
|
||||||
assign_attributes(champs_public_attributes: champs_public_attributes.map { |h| h.merge(prefilled: true) })
|
assign_attributes(champs_public_attributes: champs_public_attributes.map { |h| h.merge(prefilled: true) })
|
||||||
save(validate: false)
|
save(validate: false)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue