Which is the preferred way to determine if a chained call is nil? i.e:
company.andand.namecompany.try(:name)return nil if company.nil?; company.name(company or return nil).name
For the last one, you must use the predicate or rather than || to make the return work correctly.
I'd opt for 2.