gt == great-than

so the previous id you get with

previous = Audit.first( :id.lt => current_id )

lt == less-than or lower-than or so

and id are unique per definition and they get automatically created by
sequence or similar

FYI next and previous can be nil !

- Kristian
On Tue, Jan 22, 2013 at 5:36 PM, Alex <a...@sicanstudios.com> wrote:
> @Kristian Thanks, I haven’t tried it yet, but how does that get the next id?
> With the :id.gt ? How about the previous id?
>
>
> On Tuesday, January 22, 2013 1:13:51 PM UTC+2, kristian wrote:
>>
>> what about doing something like this :
>>
>> current_id = Audit.first.id
>> next = Audit.first( :id.gt => current_id )
>>
>> - Kristian
>
> --
> You received this message because you are subscribed to the Google Groups
> "DataMapper" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/datamapper/-/bEe_NnzF3MAJ.
>
> To post to this group, send email to datamapper@googlegroups.com.
> To unsubscribe from this group, send email to
> datamapper+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/datamapper?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to datamapper@googlegroups.com.
To unsubscribe from this group, send email to 
datamapper+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en.

Reply via email to