0
Is there a method in ruby that checks whether all objects are present? It would be something to avoid the following use:
if @stretch_source.present? && stretch_target.present?
Or would this really be the right way?
0
Is there a method in ruby that checks whether all objects are present? It would be something to avoid the following use:
if @stretch_source.present? && stretch_target.present?
Or would this really be the right way?
1
I was going to put that in comment but I don’t have enough rep.
You want to check if all the objects are present where? You can check in an array.
[@stretch_source, stretch_target].all?(&:present?)
Browser other questions tagged ruby-on-rails ruby
You are not signed in. Login or sign up in order to post.