我试图在轨道4轨道4 - 方法来检查是否所有的属性都为真
我想在一个模型编写一个方法来检查是否所有的属性都是真实的应用程序。
我想:
def ready_to_go
if
[ payment == true,
&& terms == true
&& identification == true
&& key_org == true
&& key_business == true
&& docs == true
&& funding == true
&& contract == true
&& governance == true
&& internal == true
&& preferences == true
&& address == true
&& interest == true ]
end
end
任何人都可以看看有什么不对的?
定义错误,你的意思是说它可以更简洁吗?或者它不工作?我不明白为什么你有数组语法'['和']'或者为什么它在'if'中没有任何内容。如果你只想返回true或false,那么除去if和数组语法 –
,而不是在模型'self.attributes'中尝试像这样获得该模型的所有属性。 –