Skip to content

1.0.0.rc8

Pre-release
Pre-release
Compare
Choose a tag to compare
@rudyrigot rudyrigot released this 19 Jun 23:03
· 280 commits to master since this release

_This version has a bug on the caching of the /api endpoint (the caching is forever instead of for 5 seconds); please use 1.0.0.rc9 instead._

Potentially breaking changes (if advanced usage)

  • The Documents class was renamed Response, for consistency with other kits; since Ruby is not strongly typed, most likely this won't change anything for you.

New features

  • All calls but the /api endpoint were already cached out-of-the-box (with a LRU cache). The /api endpoint should not be cached "eternally", since it is where you application goes to check if what is being served is up-to-date. However, now, for high traffic peaks, a new cache was added to the /api endpoint's call, to make sure it does not get called more than once every few seconds.
  • Expose the ID field on the Ref (for the release's ID)
  • Response.page and Response.results_per_page were aliased as Response.current_page and Results.limit_value, so that you can use the Kaminari gem out-of-the-box. Basically, if you're using Rails 3 or 4, you can:
    • add gem 'kaminari' to your Gemfile, and run bundle install
    • then, when you get a @response object from prismic.io, you can build a whole pagination for it with a single line in any of your views: <%= paginate @documents %>