avo 0.5.0.beta3 → 0.5.0.beta4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 274e5f99538c656daae6caef5484cd7f9864b4cdd8ca39a616084d73f0c66d29
|
4
|
+
data.tar.gz: 3fca117d0c913546ba43493b3e80afa6584004fc1bd91d8452e2fd57160e2802
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a600bc88614730df27fd05a8a459ee70c8513a8c7a05df55f22e8679e151e857e866c07e9c35f16ae9d65c2843a21114d730622588e7375bebac9b1d49c8a9d
|
7
|
+
data.tar.gz: b192141926944fd2f987f962eb073c01892bedde487a74d62818cf00fe1ae7aa2b6760de2843c01ddcd47f38015a1b42063ca3437d040f2a48088a6a2b8b13b2
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if @resources.present?%>
|
2
2
|
<div class="w-full grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 2xl:grid-cols-6 gap-6">
|
3
3
|
<% @resources.each_with_index do |resource, index| %>
|
4
|
-
<% cache_if Avo.configuration.cache_resources_on_index_view,
|
4
|
+
<% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_model) do %>
|
5
5
|
<%= render(Avo::Index::GridItemComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model)) %>
|
6
6
|
<% end %>
|
7
7
|
<% end %>
|
@@ -4,7 +4,7 @@
|
|
4
4
|
<%= render partial: 'avo/partials/table_header', locals: {fields: @resource.get_fields(view_type: :table, reflection: @reflection)} %>
|
5
5
|
<tbody>
|
6
6
|
<% @resources.each_with_index do |resource, index| %>
|
7
|
-
<% cache_if Avo.configuration.cache_resources_on_index_view,
|
7
|
+
<% cache_if Avo.configuration.cache_resources_on_index_view, resource.cache_hash(@parent_model) do %>
|
8
8
|
<%= render Avo::Index::TableRowComponent.new(resource: resource, reflection: @reflection, parent_model: @parent_model) %>
|
9
9
|
<% end %>
|
10
10
|
<% end %>
|
data/lib/avo/app/resource.rb
CHANGED
@@ -253,6 +253,14 @@ module Avo
|
|
253
253
|
Digest::MD5.hexdigest(content_to_be_hashed)
|
254
254
|
end
|
255
255
|
|
256
|
+
def cache_hash(parent_model)
|
257
|
+
if parent_model.present?
|
258
|
+
[self.model, self.file_hash, parent_model]
|
259
|
+
else
|
260
|
+
[self.model, self.file_hash]
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
256
264
|
# For :new views we're hydrating the model with the values from the resource's default attribute.
|
257
265
|
# We will not overwrite any attributes that come pre-filled in the model.
|
258
266
|
def hydrate_model_with_default_values
|
data/lib/avo/version.rb
CHANGED