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.
Definitely not 4, 3 is fine but more as early return style rather than one liner. 2 prob gets my vote :)