0

Suppose an ActiveRecord named "Relationships". It has an attribute "participants" which is an array containing people ID. Now I want to find the records that contain a certain people ID. How should I query it?

4

1 回答 1

0

也许你想做的是这样的:

    Student.where(:grade => [9,11,12])

如此处所示:

http://api.rubyonrails.org/classes/ActiveRecord/Base.html

于 2013-04-11T00:26:14.010 回答