Retrieve An Object If It Exists
Last updated
Was this helpful?
Last updated
Was this helpful?
Rails' Active Support provides the blank?
and present?
convenience methods as extensions to many objects. It also extends the Object class by providing the method. This method returns the receiver if it is not blank, otherwise it returns nil.
Instead of doing
I can simply do