You can check if an object is nil (null) by calling present? or blank? .
@object.present?
this will return false if the project is an empty string or nil .
or you can use
@object.blank?
this is the same as present? with a bang and you can use it if you don't like 'unless'. this will return true for an empty string or nil .