Hi i’ve made an extension for sinatra using datamapper. And I based my
code in some examples that I’ve found in github.
Now, there are some parts of the code that are not very clear:
Why do I have to call all this mode … mode … mode to add an
extension to Datamapper::Is module?
In line 15. In some way I count how many items does the collection has:
@post = Post.is_paginated
@posts = Post.paginate
How does this block get the type of the collection and the name of the
To use this extension I have to call the is_paginated method first. Why
is that? and Is there any automated way to do it?
The complete code of the extension is in here:
Thanks for all!