avo 2.32.6 → 2.33.1

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: 6cd2f99c299bdf5412dbf9650696b335b9157c226c3f24fb0d80b04b6d9a5eae
4
- data.tar.gz: 3586667c9311be37ed01fc950afca11455e08a3e02fa14965797c7c25119dbb3
3
+ metadata.gz: 7702d60d831cd5fbcb1f1b4f7eab70336d6e71e07c19fd6d25a2627d6569e122
4
+ data.tar.gz: 22d9fab7fd3ce81fb3c62165bd544822d001bbabd97ed380b53280eb0b2e1649
5
5
  SHA512:
6
- metadata.gz: 76635e0735361495b584e9cff07913733c10016403c6d572098f9c6d793cb8403741d2eb789dd1105941cbff3232b98ab2882314ccb3c5172532fe5f3bf8e3cb
7
- data.tar.gz: a0a1799b442787df8e39537f64ad8380a1a82d30baa4c58fe4f14eee294100ba814187ecfbbed8c2471bf04b0287ae0bbe10c2151a8573e2c1c40a282fb8a7b0
6
+ metadata.gz: 5612be2a2e685fb664841d6c9c69640a5c78ae61830f15571d5425c06b9b22cc902938a4f7fbd4d09d841fc47fde58545c127018fde4df774a0da5cc48811b0e
7
+ data.tar.gz: ad4df4eb5fd776e678a80432a42e25f04a67b6cbb3ed2e5d0b0f2ba557d50dc7f8ab253cd2456193227169b7b4f1c32b19fafc50549dcc13f054d9da3719fea1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (2.32.6)
4
+ avo (2.33.1)
5
5
  actionview (>= 6.0)
6
6
  active_link_to
7
7
  activerecord (>= 6.0)
@@ -52,7 +52,7 @@ module Avo
52
52
  ).handle
53
53
 
54
54
  # Get the count
55
- results_count = query.reselect(:id).count
55
+ results_count = query.reselect(resource.model_class.primary_key).count
56
56
 
57
57
  # Get the results
58
58
  query = query.limit(8)
data/lib/avo/app.rb CHANGED
@@ -44,7 +44,7 @@ module Avo
44
44
  when "ActiveSupport::Cache::MemCacheStore", "ActiveSupport::Cache::RedisCacheStore"
45
45
  Rails.cache
46
46
  else
47
- ActiveSupport::Cache.lookup_store(:file_store, "/tmp/cache")
47
+ ActiveSupport::Cache.lookup_store(:file_store, Rails.root.join("tmp", "cache"))
48
48
  end
49
49
  elsif Rails.env.test?
50
50
  Rails.cache
data/lib/avo/engine.rb CHANGED
@@ -72,6 +72,11 @@ module Avo
72
72
  require_relative "../generators/model_generator"
73
73
  end
74
74
 
75
+ initializer "avo.locales" do |app|
76
+ I18n.load_path += Dir[Avo::Engine.root.join("lib", "generators", "avo", "templates", "locales", "*.{rb,yml}")]
77
+ I18n.load_path += Dir[Rails.root.join("config", "locales", "*.{rb,yml}")]
78
+ end
79
+
75
80
  # After deploy we want to make sure the license response is being cleared.
76
81
  # We need a fresh license response.
77
82
  # This is disabled in development because the initialization process might be triggered more than once.
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "2.32.6" unless const_defined?(:VERSION)
2
+ VERSION = "2.33.1" unless const_defined?(:VERSION)
3
3
  end
@@ -13,7 +13,6 @@ module Generators
13
13
  route "mount Avo::Engine, at: Avo.configuration.root_path"
14
14
 
15
15
  template "initializer/avo.tt", "config/initializers/avo.rb"
16
- directory File.join(__dir__, "templates", "locales"), "config/locales"
17
16
  create_resources
18
17
  end
19
18
 
@@ -135,6 +135,9 @@ module Generators
135
135
  fields_string = "\n # Fields generated from the model"
136
136
 
137
137
  fields.each do |field_name, field_options|
138
+ # if field_options are not available (likely a missing resource for an association), skip the field
139
+ fields_string += "\n # Could not generate a field for #{field_name}" and next unless field_options
140
+
138
141
  options = ""
139
142
  field_options[:options].each { |k, v| options += ", #{k}: #{v}" } if field_options[:options].present?
140
143
 
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: 2.32.6
4
+ version: 2.33.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Marin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-05-18 00:00:00.000000000 Z
12
+ date: 2023-05-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord