2012-10-15 42 views

回答

10

你可以!它会是这个样子:

users = User.all(:id => [1,2,3]) 

编辑:你可以看到这对github page for dm-core

# If the value of a pair is an Array, we do an IN-clause for you. 
    Person.all(:name.like => 'S%', :id => [ 1, 2, 3, 4, 5 ]) 

    # Does a NOT IN() clause for you. 
    Person.all(:name.not => [ 'bob', 'rick', 'steve' ]) 
+2

DM monkeypatches符号? egads。 –

相关问题