README.md in findit-1.4.0 vs README.md in findit-1.4.1
- old
+ new
@@ -154,11 +154,11 @@
@posts = PostFinder.new(user: current_user)
end
end
#/app/views/posts/index.html.erb
-<% cache(@posts, expire_in: 30.minutes) do %>
+<% cache(@posts, expires_in: 30.minutes) do %>
<%=render 'post', collection: @posts, as: :post%> # it will automaticly iterate over finder results by each method
```
### WillPaginate
@@ -195,11 +195,11 @@
@posts = PostFinder.new(params[:page], params[:per_page])
end
end
# app/views/posts/index.html.erb
-<% cache(@posts, expire_in: 30.minutes) do %>
+<% cache(@posts, expires_in: 30.minutes) do %>
<%= render 'post', collection: @posts, as: :post %>
<%= will_paginate @posts %>
```
### Single
@@ -230,11 +230,11 @@
```
### Cache
Extends finder with cache possibility. Every call of `call` method will be cached in `Rails.cache`.
-Method `cache options` allows you to add custom options like `expire_in` or `tags` to `Rails.cache.fetch`.
+Method `cache options` allows you to add custom options like `expires_in` or `tags` to `Rails.cache.fetch`.
If you want to disable cache dependent of initialization arguments, you can use `cache?` DSL method.
All in one Example:
```ruby
# app/finders/post_finder.rb
@@ -245,10 +245,10 @@
cache_key do
@user
end
cache_options do
- {expire_in: 15.minutes} # This will be directly passed to Rails.cache.fetch
+ {expires_in: 15.minutes} # This will be directly passed to Rails.cache.fetch
end
def initialize(user)
@user = user
end