集合中的任何元素都是真的

时间:2015-09-12 18:01:39

标签: ruby-on-rails ruby activerecord

我有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> ) } organizationsadvisors的关系。 organization_advisors的字段为organization_advisors。我想找到is_verifiedadvisors为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。我该怎么做?

1 个答案:

答案 0 :(得分:2)

试试这个:

<% unless @organization.advisors.where(is_verified: false).any? %>
    Approve Advisors
<% end %>