Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 从集合中,根据条件获取新集合。-轨道_Ruby On Rails_Ruby - Fatal编程技术网

Ruby on rails 从集合中,根据条件获取新集合。-轨道

Ruby on rails 从集合中,根据条件获取新集合。-轨道,ruby-on-rails,ruby,Ruby On Rails,Ruby,我有这个疑问events=eventswhere(“从开始,您需要: events.where("ticket_types <> ''") 如果ticket\u types为布尔值,则可以执行事件。其中(“tickets=?”,ticket\u types.present?,因为ticket\u types.present?将为您提供true或false什么是ticket\u类型?它是事件表上的一列吗?另一种关系? events.where.not(ticket_types: ''

我有这个疑问
events=eventswhere(“从开始,您需要:

events.where("ticket_types <> ''")

如果
ticket\u types
为布尔值,则可以执行
事件。其中(“tickets=?”,ticket\u types.present?
,因为
ticket\u types.present?
将为您提供
true
false
什么是
ticket\u类型
?它是
事件表上的一列吗?另一种关系?
events.where.not(ticket_types: '')