object.presence</code>is equivalent toobject.present? ? object : nil</code>
Usarregion = params[:state].presence || params[:country].presence || 'US'</code>
em vez de
state = params[:state] if params[:state].present?
country = params[:country] if params[:country].present?
region = state || country || 'US'</code></pre>