Ok let me give you more context:
def process_relation(relation)
return something else when relation.is_none?
# do some more processing here since we know relation will return
results and then return processed result
end
The problem is if I need to figure out whether a relation
But the thing is if you are passed a relation as method argument, how you
check whether its a none relation ? It's similar to checking nil on a
method argument
On Monday, January 6, 2014 6:06:53 PM UTC+5:30, Yves Senn wrote:
Hey,
I agree with Gabriel Sobrinho. This check goes against the
Shadab, if I get you correctly you don't want to do extra processing on an
object if its NullRelation, based on the fact the default value for a
result from
the relation would be 0/nil etc, ex: size would return 0.
I don't think differentiating on the basis of this is a good idea, the
basis of
That's the only way right now.
Although, seems wrong to me check if a relation is a null relation, that's
the point of null objects, you should not know that's a null object at all
(may be necessary in your case but seems wrong to me).
What you can do is something like `relation.empty?' which
Hey,
I agree with Gabriel Sobrinho. This check goes against the point of having
a NullRelation at all. Maybe you can provide more context about your
use-case and why you need that check.
On Monday, January 6, 2014 7:35:56 AM UTC+1, Shadab Ahmed wrote:
Hey,
I am passing a relation to a