avo 3.0.0.pre7 → 3.0.0.pre8
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/lib/avo/base_resource.rb +4 -12
- data/lib/avo/version.rb +1 -1
- 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: 1330e65c3c0ee5eda7738928fe8b9dc98a75df09fc9d30012e94c714767233b1
|
4
|
+
data.tar.gz: ab36b3c80f8ae22c48fc2529373b507616746c6f7e711ebff1210c902a1b3a9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c351cedaf01797b64483591b0f5a96bb4ee1dedef576df314b55d7bb668505e601220b4eef33cabdebcf19162508adbc4ad49f6326cad2932d2fe792e31e848f
|
7
|
+
data.tar.gz: 4aa891eab38f40b7468f43327e26175963b9c1e95016d09756ddac428863e69e3ad000124d04e67570c0f9a1d7ff73196b282b4de76a45f4856814296d04dea3
|
data/Gemfile.lock
CHANGED
data/lib/avo/base_resource.rb
CHANGED
@@ -53,9 +53,7 @@ module Avo
|
|
53
53
|
class_attribute :grid_loader
|
54
54
|
class_attribute :visible_on_sidebar, default: true
|
55
55
|
class_attribute :unscoped_queries_on_index, default: false
|
56
|
-
class_attribute :
|
57
|
-
class_attribute :resolve_find_scope
|
58
|
-
# TODO: refactor this into a Host without args
|
56
|
+
class_attribute :index_query
|
59
57
|
class_attribute :find_record_method, default: -> {
|
60
58
|
query.find id
|
61
59
|
}
|
@@ -111,8 +109,8 @@ module Avo
|
|
111
109
|
|
112
110
|
# This resolves the scope when doing "where" queries (not find queries)
|
113
111
|
def query_scope
|
114
|
-
final_scope = if
|
115
|
-
Avo::ExecutionContext.new(target:
|
112
|
+
final_scope = if index_query.present?
|
113
|
+
Avo::ExecutionContext.new(target: index_query, query: model_class).handle
|
116
114
|
else
|
117
115
|
model_class
|
118
116
|
end
|
@@ -122,13 +120,7 @@ module Avo
|
|
122
120
|
|
123
121
|
# This resolves the scope when finding records (not "where" queries)
|
124
122
|
def find_scope
|
125
|
-
|
126
|
-
Avo::ExecutionContext.new(target: resolve_find_scope, query: model_class).handle
|
127
|
-
else
|
128
|
-
model_class
|
129
|
-
end
|
130
|
-
|
131
|
-
authorization.apply_policy final_scope
|
123
|
+
authorization.apply_policy model_class
|
132
124
|
end
|
133
125
|
|
134
126
|
def authorization
|
data/lib/avo/version.rb
CHANGED