avo 3.13.4 → 3.13.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/avo/configuration.rb +6 -2
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/tool_generator.rb +8 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d9c4eb2698e3f5ee29c5b2c6dd833de301452c210e1deb444fce7d32f856fbaf
|
4
|
+
data.tar.gz: 161cf6eb2ecf4779f95427134a5f950eb7821ec4774171964449ad53b0168cda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983c4f7f9d83480658bafe2f9f8bfee6372e45d9e59637f69bfc4f5aefc7ecb6d48d5ed3aa38127dbfa2e684bfdb499eef2e552913413d034094fb0fff6ee98d
|
7
|
+
data.tar.gz: b8ff6292ccb2e822031cac857273ea9b37565e6973935408aabad71551f32a7a641b19283a26cf792f15f49f9ba66106d33eef6751bad7b1814b8c59340281cb
|
data/Gemfile.lock
CHANGED
data/lib/avo/configuration.rb
CHANGED
@@ -36,7 +36,7 @@ module Avo
|
|
36
36
|
attr_accessor :display_license_request_timeout_error
|
37
37
|
attr_accessor :current_user_resource_name
|
38
38
|
attr_accessor :raise_error_on_missing_policy
|
39
|
-
|
39
|
+
attr_writer :disabled_features
|
40
40
|
attr_accessor :buttons_on_form_footers
|
41
41
|
attr_accessor :main_menu
|
42
42
|
attr_accessor :profile_menu
|
@@ -155,8 +155,12 @@ module Avo
|
|
155
155
|
@root_path
|
156
156
|
end
|
157
157
|
|
158
|
+
def disabled_features
|
159
|
+
Avo::ExecutionContext.new(target: @disabled_features).handle
|
160
|
+
end
|
161
|
+
|
158
162
|
def feature_enabled?(feature)
|
159
|
-
|
163
|
+
!disabled_features.map(&:to_sym).include?(feature.to_sym)
|
160
164
|
end
|
161
165
|
|
162
166
|
def branding
|
data/lib/avo/version.rb
CHANGED
@@ -40,13 +40,14 @@ module Generators
|
|
40
40
|
# bin/rails generate avo:tool lolo
|
41
41
|
# will generate the avo.lolo_path helper
|
42
42
|
# THe fact that it will always generate the definded? and Avo::Engine.routes.draw wraps is unfortunate. We'd love a PR to fix that.
|
43
|
-
route_contents =
|
44
|
-
|
45
|
-
if defined? ::Avo
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
end
|
43
|
+
route_contents = <<~ROUTE
|
44
|
+
|
45
|
+
if defined? ::Avo
|
46
|
+
Avo::Engine.routes.draw do
|
47
|
+
# This route is not protected, secure it with authentication if needed.
|
48
|
+
get "#{file_name}", to: "tools##{file_name}", as: :#{file_name}
|
49
|
+
end
|
50
|
+
end
|
50
51
|
ROUTE
|
51
52
|
append_to_file "config/routes.rb", route_contents
|
52
53
|
|