avo 0.5.0.beta3 → 0.5.0.beta4

Sign up to get free protection for your applications and to get access to all the features.

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: a01263a88047ada56ed5010750210945dd7b6c60493b6db08f5c6c0eb8588363
4
- data.tar.gz: 1231108c022e42dbfcc73568ee428f16f37c8ee7fcfffec0199d907c080604b4
3
+ metadata.gz: 274e5f99538c656daae6caef5484cd7f9864b4cdd8ca39a616084d73f0c66d29
4
+ data.tar.gz: 3fca117d0c913546ba43493b3e80afa6584004fc1bd91d8452e2fd57160e2802
5
5
  SHA512:
6
- metadata.gz: 6c10735c0053dd06808dcce9b03be9b8c2025e020c05a3ae004a71e9ca6f2abcf793bf90dc84790b1097739fb9026980542078a2467036cfe605c771af834cfb
7
- data.tar.gz: d7d111eb914b662998c288ee9aa399a52b27dabb57be7c1c316924b6ad8f7d31ff0e27491865c761f8d777e3cdfc15c8e9b48a910d69bf10eec8df57a4439f73
6
+ metadata.gz: 5a600bc88614730df27fd05a8a459ee70c8513a8c7a05df55f22e8679e151e857e866c07e9c35f16ae9d65c2843a21114d730622588e7375bebac9b1d49c8a9d
7
+ data.tar.gz: b192141926944fd2f987f962eb073c01892bedde487a74d62818cf00fe1ae7aa2b6760de2843c01ddcd47f38015a1b42063ca3437d040f2a48088a6a2b8b13b2
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (0.5.0.beta3)
4
+ avo (0.5.0.beta4)
5
5
  active_link_to
6
6
  countries
7
7
  hotwire-rails
@@ -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, [resource.model, resource.file_hash] do %>
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, [resource.model, resource.file_hash] do %>
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 %>
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = '0.5.0.beta3'
2
+ VERSION = '0.5.0.beta4'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0.beta3
4
+ version: 0.5.0.beta4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin