Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
3 votes
2 answers
102 views

Persist relation to a class (and not a class instance) in Ruby on Rails with Mongoid

Assume my users can subscribe to several plan_types. I want to define those plans as classes, and be able to keep, for each user, a reference to a subscription_plan and also a presubscription_plan. ...
Cyril Duchon-Doris's user avatar
0 votes
1 answer
131 views

List User Online Status

I'm using Rails with MongoDB for database. In my apps I have 1 action for displaying list of users. User has name, image, ...
itx's user avatar
  • 269
2 votes
0 answers
492 views

Scoping through embedded document in MongoId

I'm using MongoId in a Rails project. I need to select some products which contain some SKUs which has an embedded document. The models are respectively Product and ...
Laurent's user avatar
  • 213
1 vote
2 answers
2k views

Finding mongodb records in batches using mongoid [closed]

I want to get records in batches. But mongoid doc says to avoid using skip due as it can be expensive. I wrote this method to iterate through a large number records efficiently. ...
tessie's user avatar
  • 315
3 votes
1 answer
97 views

Probability ordering by seller's tariff

I have an instance method which calculates the position of an element, depending on the tariff of its seller. If the seller is of a level3 tariff, it gets to top ...
schumi's user avatar
  • 33