forest_admin_rails 1.12.1 → 1.12.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '099b5f8e72f047e94d152def7e081f05321c7bf0b1aaa75f0484c917acd7fc61'
4
- data.tar.gz: 0af28ac77c06cbed7cb5212c244232a1f3a3e42aa64a49f02c34281f821d61a9
3
+ metadata.gz: 3f8e76e19bc58b11c12dd6d31f125fbe0543d6f33ff4463d9454e68ec43fdb4f
4
+ data.tar.gz: 130779408d7ecf0879ec80cc1cf1fef5be06b7f48848e7e0dcb9ca741ee43783
5
5
  SHA512:
6
- metadata.gz: c1c0422ec8739e19267569261e0afe16e1cca5f1673cbf65ceab6142000c9df32b96235745fad440b16e67d4f9751a1b1785ed6b15fde86f404f4e62dd09c973
7
- data.tar.gz: ab902ad4d0e18a6f5dd332f9e358f7d018208f7c931984f86b7ebeafe0b3717c23058f2a723adfbe32ccfc599df483d3bb67ab54535e17b1d0720489f9eed043
6
+ metadata.gz: 6116cedc55a13e68579903a099466eff89536c679f46c87dcbe787c74010ad3268983f5188d33adac1ebce34e4ad177cd0cd6195faa94e20e4aefef25dba18d3
7
+ data.tar.gz: 484024339f54c3a375ef3d65ac8d2ca9f5c1154be65491e0fa33eab698876d8e2319717bb1a3ece1850f6a2b5251524c77dd2ce340f0386b3495faf702529fe0
@@ -24,6 +24,10 @@ module ForestAdminRails
24
24
 
25
25
  extend ActiveSupport::Concern
26
26
 
27
+ initializer 'forest_admin_rails.add_autoload_paths', before: :set_autoload_paths do |app|
28
+ app.config.autoload_paths << Rails.root.join('lib')
29
+ end
30
+
27
31
  initializer 'forest_admin_rails.error_subscribe' do
28
32
  Rails.error.subscribe(ForestAdminErrorSubscriber.new)
29
33
  end
@@ -39,7 +43,28 @@ module ForestAdminRails
39
43
 
40
44
  def load_configuration
41
45
  return unless running_web_server?
42
- return unless File.exist?(Rails.root.join('app', 'lib', 'forest_admin_rails', 'create_agent.rb'))
46
+
47
+ old_path = Rails.root.join('app', 'lib', 'forest_admin_rails', 'create_agent.rb')
48
+ new_path = Rails.root.join('lib', 'forest_admin_rails', 'create_agent.rb')
49
+
50
+ # Check for old location and warn user
51
+ if File.exist?(old_path) && !File.exist?(new_path)
52
+ logger = ActiveSupport::Logger.new($stdout)
53
+ logger.warn <<~WARNING
54
+ ⚠️ DEPRECATION WARNING: create_agent.rb detected in old location!
55
+
56
+ The file 'app/lib/forest_admin_rails/create_agent.rb' should now be located at:
57
+ 'lib/forest_admin_rails/create_agent.rb'
58
+
59
+ Please move your file to the new location:
60
+ mkdir -p lib/forest_admin_rails
61
+ mv app/lib/forest_admin_rails/create_agent.rb lib/forest_admin_rails/create_agent.rb
62
+
63
+ This will become a hard requirement in a future version.
64
+ WARNING
65
+ end
66
+
67
+ return unless File.exist?(new_path) || File.exist?(old_path)
43
68
 
44
69
  # force eager loading models
45
70
  Rails.application.eager_load!
@@ -1,3 +1,3 @@
1
1
  module ForestAdminRails
2
- VERSION = "1.12.1"
2
+ VERSION = "1.12.2"
3
3
  end
@@ -8,7 +8,7 @@ module ForestAdminRails
8
8
  @auth_secret = SecureRandom.hex(20)
9
9
  @env_secret = env_secret
10
10
  template 'initializers/config.rb', 'config/initializers/forest_admin_rails.rb'
11
- template 'create_agent.rb', 'app/lib/forest_admin_rails/create_agent.rb'
11
+ template 'create_agent.rb', 'lib/forest_admin_rails/create_agent.rb'
12
12
  route 'mount ForestAdminRails::Engine => "#{ForestAdminRails.config[:prefix]}"'
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_admin_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.1
4
+ version: 1.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthieu