I've been recently allocated to a new Rails project in which I could see assignments to variables are made using ||=
instead of =
. Can any one help me understand if this is a correct way or a good practice in Rails and the advantages/disadvantages of using it?
e.g.
a ||= b + c
(b
and c
are integers)
Thanks for any help :)