0

It's better to explain this in pseudo-code, I want to do this:

limit_object = Model.first(id: bla)
objects = Model.all(constraint: limit_object, limit: 30)

If the objects are:

[a, b, c, d, e, f, g]

and limit_object is 'c', it should return:

[a, b, c]

Is there a way to do this in DataMapper?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Mert Dümenci
  • 493
  • 1
  • 5
  • 18

1 Answers1

0

Okay, I found it:

quotes = Model.all(:for_date.lte => date, limit: 10)
the Tin Man
  • 158,662
  • 42
  • 215
  • 303
Mert Dümenci
  • 493
  • 1
  • 5
  • 18