Why doesn't this work:
ruby-1.8.7-p249 > List.create :search_terms => 'foo'
=> #<Li开发者_运维问答st _id: 4c9044a02249c7a5e2000001, search_terms: "foo", user_id: nil>
ruby-1.8.7-p249 > List.all
=> #<Mongoid::Criteria:0x1030dea90 @klass=List, @documents=[], @selector={}, @options={}>
ruby-1.8.7-p249 > List.all.documents
=> []
I think what you're looking for is:
List.all.to_a
精彩评论