This doesn't really make logical sense to me. Let's say you're doing something like this:
@current_user ||= User.find_by(id: :session[:user_id])
It seems to me to make logical sense to check whether @current_user
is nil. Then if it is nil do the OR
operation.
So why is this written in ruby as ||=
rather than =||
?
Same goes for something like this:
x += 1