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
|
||||
|
||||
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) })
|
||||
save(validate: false)
|
||||
|
|
Loading…
Reference in a new issue