Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Rails 5.2 - cache is not being updated

$
0
0

I have this scheme in my views:

_user_data.html.erb:

<tbody><%= render partial: 'edit_history_inline_user', collection: @presenter.collection, as: :user, cached: Proc.new{|user| [acl_fingerprint, 'history', user.record] } %></tbody>

_edit_history_inline_user.html.erb:

<td class="align_center"><%= user.first_name %></td><td class="align_center"><%= user.last_name %></td>...

The problem is that when I update the user model, the data in the _edit_history_inline_user.html.erb are not being updated. If I make some change, though, in the _edit_history_inline_user.html.erb file, such as (adding the -- characters):

<td class="align_center">  -- <%= user.first_name %> --</td>

The correct/recently modified data will be displayed. How is that possible? Why the modified data does not show up correctly?

Here's the acl_fingerprint method that I use in the parent partial view:

def acl_fingerprint  Rails.cache.fetch("#{current_admin.cache_key(:current_sign_in_at, :updated_at)}/acl_fingerprint", expires_in: 3.hours) do    CacheService.acl_fingerprint(current_admin, params[:controller])  endend

How do I fix this issue?

Any help will be appreciated!


Viewing all articles
Browse latest Browse all 873

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>