阅读背景:

如果Rails对象包含特定列中的特定值,则返回布尔值

来源:互联网 

I'm trying to write a rails/activerecord query that returns true if a rails object contains a specific value. I have a join table called 'Events' between 'Users' and 'Bicycles' and the Events table has a column called 'event_type'. I'm trying to find out if a specific Bicycle's last created event contains the event_type 'stolen'. I want to return only true or false, not the rails object itself. I'm trying to write a rails/activerecord query




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: