christospappas / streama

Streama is a simple activity stream gem for use with the Mongoid ODM framework.
MIT License
133 stars 31 forks source link

Index definition syntax #26

Closed dmitrytrager closed 11 years ago

dmitrytrager commented 11 years ago

I'm able to use streama with mongoid 2.4.12 and when I'm trying to perform rake db:mongoid:create_indexes it says me:

Invalid index specification {:name=>1}; should be either a string, symbol, or an array of arrays.

It's caused by Streama::Activity module content.

Also I can not understand, why this module is trying to index name field, that was not defined before. Thanks.

niedhui commented 11 years ago

I think you should use mongoid 3.x.x. the 2.x.x index syntax is

  index [:name, 1]

the 3.x.x index syntx is

  index({name: 1})

and it seems the name is really unnecessary :)

dmitrytrager commented 11 years ago

I think, gem should check what mongoid version is used :) Now it allows to use 2 and 3, but index is written only with 3.x.x syntax. What do you think about that?

niedhui commented 11 years ago

@dmitrytrager I'll try to fix it , remove the unused index, and mongoid 3 dependency . : )

christospappas commented 11 years ago

thanks guys, i've pulled in your changes.