Avoiding null in variable assignment
If object is either nil or a string, you can just do value = object || "".

If it can be anything and you want to get a string, your second solution doesn't actually do what you want, since it won't turn the object into a string if it's not nil. To fix that your second solution would become value = object.nil? ? object.to_s : "". Of course since now you're calling to_s in both solutions there is no reason to prefer the second over the first, so I'd go with the first.