madmin 2.1.3 → 2.2.1

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: 98cd062a740eb34ed7d97445424c1bc8ed2ca044d5c7a0249ddafb85c1d47696
4
- data.tar.gz: c5b46f3800e5b950703e09b8b9bc18ea8a87d64fce310e5038d360af1b35b83e
3
+ metadata.gz: ca659d30c381297068616d7a51c89b00e60df503a44a9bfe667ba3330ebddbe8
4
+ data.tar.gz: f8d5bbfb4d9672e817a841eeda918501ad086e5184da6b188a7a7b4bd1dfbcb7
5
5
  SHA512:
6
- metadata.gz: 0eb8b624193e5832242142b296edffe6a7e071a7ab766554d9c121e4c7d5526b82a6bf7ab46a9af511c8d8858cfd8c3131f83479fc08dba5093b8a95f4f95e6c
7
- data.tar.gz: d2b68cc4f02941779aeab65676f01e931624e3237a31bbbab189a09ac4293835064f1388f79f8c219ce622d7c07a67600723dff2ca880470cd7e75f7ab41419e
6
+ metadata.gz: 12c7205ca6197e20175bfe1789110825c2ed6adc0c5ed97c63a1a7b7609150d0dba54838d05f9ba870d5ade58938ff9900344e553f94a0e2944a7a7ae186de59
7
+ data.tar.gz: e922436e1ad3116fbf932819b2b73d817e3ac3dafead25737d8ae3c58dd58e12215fb82170cf1e527438e2f3e569a0f207c45ab8b4579b27bdce6d838d99e13f
data/lib/madmin/engine.rb CHANGED
@@ -5,8 +5,15 @@ module Madmin
5
5
  isolate_namespace Madmin
6
6
 
7
7
  config.before_configuration do |app|
8
- app.config.eager_load_paths << File.expand_path("app/madmin/resources", Rails.root)
9
- app.config.eager_load_paths << File.expand_path("app/madmin/fields", Rails.root)
8
+ app.config.eager_load_paths << app.root.join("app/madmin/resources")
9
+ app.config.eager_load_paths << app.root.join("app/madmin/fields")
10
+ Madmin.resource_locations << Rails.root.join("app/madmin/resources/")
11
+
12
+ Rails::Engine.subclasses.each do |engine|
13
+ app.config.eager_load_paths << engine.root.join("app/madmin/resources")
14
+ app.config.eager_load_paths << engine.root.join("app/madmin/fields")
15
+ Madmin.resource_locations << engine.root.join("app/madmin/resources/")
16
+ end
10
17
  end
11
18
 
12
19
  config.to_prepare do
data/lib/madmin/search.rb CHANGED
@@ -50,7 +50,7 @@ module Madmin
50
50
  end
51
51
 
52
52
  def query_table_name(attr)
53
- ::ActiveRecord::Base.connection.quote_column_name(@scoped_resource.table_name)
53
+ ::ActiveRecord::Base.connection.quote_table_name(@scoped_resource.table_name)
54
54
  end
55
55
 
56
56
  def column_to_query(attr)
@@ -1,3 +1,3 @@
1
1
  module Madmin
2
- VERSION = "2.1.3"
2
+ VERSION = "2.2.1"
3
3
  end
data/lib/madmin.rb CHANGED
@@ -40,6 +40,7 @@ module Madmin
40
40
  mattr_accessor :menu, default: Menu.new
41
41
  mattr_accessor :site_name
42
42
  mattr_accessor :stylesheets, default: []
43
+ mattr_accessor :resource_locations, default: []
43
44
 
44
45
  class MissingResource < StandardError
45
46
  end
@@ -99,9 +100,10 @@ module Madmin
99
100
  end
100
101
 
101
102
  def resource_names
102
- root = Rails.root.join("app/madmin/resources/")
103
- files = Dir.glob(root.join("**/*.rb"))
104
- files.sort!.map! { |f| f.split(root.to_s).last.delete_suffix(".rb").classify }
103
+ resource_locations.flat_map do |root|
104
+ files = Dir.glob(root.join("**/*.rb"))
105
+ files.sort!.map! { |f| f.split(root.to_s).last.delete_suffix(".rb").classify }
106
+ end
105
107
  end
106
108
  end
107
109
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madmin
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.3
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Oliver