avo 1.14.0 → 1.15.0.pre.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 +4 -4
- data/Gemfile.lock +1 -1
- data/app/controllers/avo/application_controller.rb +22 -4
- data/app/controllers/avo/base_controller.rb +1 -1
- data/lib/avo/app.rb +2 -0
- data/lib/avo/version.rb +1 -1
- data/public/avo-packs/css/application-2b4685ca.css.map +1 -1
- data/public/avo-packs/css/application-2b4685ca.css.map.br +0 -0
- data/public/avo-packs/css/application-2b4685ca.css.map.gz +0 -0
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map +1 -1
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map.br +0 -0
- data/public/avo-packs/js/application-6dbb940fca2e811fb7d5.js.map.gz +0 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d383ac646109d2df17ad55051991565b86751396b90f07bed6febd2c74ec2a3b
|
4
|
+
data.tar.gz: 165d98536e64218b88b4cd4e3191cabf1ccda0469d3bd85d84d1498097c1404f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d3981465a470c93bef51cea94d4fe2b1cd3473e0e07bcbd5e7bdd2dcc7749d14ad9560fe2b46794e8e41a4554725cefaab61b68908ede56d3f6cf1bda54d42b7
|
7
|
+
data.tar.gz: c96ee899de497fa540760abab565bbca84b4d40b074159e73403661604fefffa3bca342bbf8407c07a27bbaad0c95d3c2cf5f1dccd4f72376b3ce73a508d7c5f
|
data/Gemfile.lock
CHANGED
@@ -97,9 +97,9 @@ module Avo
|
|
97
97
|
end
|
98
98
|
|
99
99
|
def resource_path(model = nil, resource_id: nil, keep_query_params: false, **args)
|
100
|
-
return avo.send :"resources_#{model
|
100
|
+
return avo.send :"resources_#{singular_name(model)}_path", resource_id, **args if resource_id.present?
|
101
101
|
|
102
|
-
avo.send :"resources_#{model
|
102
|
+
avo.send :"resources_#{singular_name(model)}_path", model, **args
|
103
103
|
end
|
104
104
|
|
105
105
|
def resource_attach_path(model_name, model_id, related_name, related_id = nil)
|
@@ -119,11 +119,11 @@ module Avo
|
|
119
119
|
end
|
120
120
|
|
121
121
|
def new_resource_path(model, **args)
|
122
|
-
avo.send :"new_resources_#{model
|
122
|
+
avo.send :"new_resources_#{singular_name(model)}_path", **args
|
123
123
|
end
|
124
124
|
|
125
125
|
def edit_resource_path(model, **args)
|
126
|
-
avo.send :"edit_resources_#{model
|
126
|
+
avo.send :"edit_resources_#{singular_name(model)}_path", model.id, **args
|
127
127
|
end
|
128
128
|
|
129
129
|
private
|
@@ -283,5 +283,23 @@ module Avo
|
|
283
283
|
def on_api_path
|
284
284
|
request.original_url.match?(/.*#{Avo::App.root_path}\/avo_api\/.*/)
|
285
285
|
end
|
286
|
+
|
287
|
+
def get_model_class(model)
|
288
|
+
if model.instance_of?(Class)
|
289
|
+
model
|
290
|
+
else
|
291
|
+
model.class
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
def singular_name(model_or_class)
|
296
|
+
model_class = get_model_class model_or_class
|
297
|
+
|
298
|
+
if ActiveModel::Naming.uncountable? model_class
|
299
|
+
model_class.model_name.route_key.singularize.gsub('_index', '')
|
300
|
+
else
|
301
|
+
model_class.model_name.route_key.singularize
|
302
|
+
end
|
303
|
+
end
|
286
304
|
end
|
287
305
|
end
|
data/lib/avo/app.rb
CHANGED
data/lib/avo/version.rb
CHANGED