我有render() {
return (
<div>
<form onSubmit={this.handleSubmit} className={this.props.className}
noValidate>
{React.Children.map(this.props.children, this.renderChild)}
</form>
{this.state.busy ? <SmartSpinner /> : ""}
</div>
)
}
和organizations
到advisors
的关系。 organization_advisors
的字段为organization_advisors
。我想找到is_verified
为advisors
为false的特定organization
的{{1}}。像这样的东西(它不起作用)
is_verified
我也尝试过:
<% unless @organization.advisors.is_verified.any? %>
Approve Advisors
<% end %>
我需要知道<% unless @organization.organization_advisors.is_verified.any? %>
Approve Advisors
<% end %>
的任何顾问是否都不是@organization
。我该怎么做?
答案 0 :(得分:2)
试试这个:
<% unless @organization.advisors.where(is_verified: false).any? %>
Approve Advisors
<% end %>