azahara_schema 0.3.10 → 0.3.11
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 +4 -4
- data/app/views/azahara_schema/_filters.html.erb +3 -3
- data/lib/azahara_schema/aggregation_attribute.rb +3 -1
- data/lib/azahara_schema/field_format.rb +4 -0
- data/lib/azahara_schema/model_schema.rb +3 -3
- data/lib/azahara_schema/schema.rb +6 -2
- data/lib/azahara_schema/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d4ebb4cfbf9b88aedd63379c567022ffd313d71ab6496b1b4c15abd85c7bc795
|
|
4
|
+
data.tar.gz: c90d23fd01a59ba6668d7439e269398c8481d4f906dcb13a680bc65d5f6f0869
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33378116e789f9ab91ac6b952480d630212db2b3e847a2efbd15a9c3c1b59932ade15d2b60f18dc7d261fffef1460cca1f19bf784507ab31d34d78016ac5482f
|
|
7
|
+
data.tar.gz: a8a150f7d0c0d4c5295fde70aaaebd52cb973d362dc07d3813f50968acbf6212aeaa6711747cef612831337be839f6bc6385aac9373df58dbfb7c33ebca32129
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
<%= azahara_filter_row(schema, filter, name) %>
|
|
5
5
|
<% end %>
|
|
6
6
|
</div>
|
|
7
|
-
<% if schema.collapsable_filters.any? || lookup_context.template_exists?("#{schema.model.
|
|
7
|
+
<% if schema.collapsable_filters.any? || lookup_context.template_exists?("#{ActiveSupport::Inflector.tableize(schema.model.name)}/_additional_filters") %>
|
|
8
8
|
<div id="filters_collapsable" class="collapse">
|
|
9
9
|
<% schema.collapsable_filters.each do |name, filter| %>
|
|
10
10
|
<%= azahara_filter_row(schema, filter, name) %>
|
|
11
11
|
<% end %>
|
|
12
|
-
<% if lookup_context.template_exists?("#{schema.model.
|
|
13
|
-
<%= render "#{schema.model.
|
|
12
|
+
<% if lookup_context.template_exists?("#{ActiveSupport::Inflector.tableize(schema.model.name)}/_additional_filters") %>
|
|
13
|
+
<%= render "#{ActiveSupport::Inflector.tableize(schema.model.name)}/additional_filters", schema: schema %>
|
|
14
14
|
<% end %>
|
|
15
15
|
</div>
|
|
16
16
|
<div class="collapse-actions" style="text-align: center;">
|
|
@@ -21,7 +21,9 @@ module AzaharaSchema
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def value(parent)
|
|
24
|
-
attribute.attribute.add_join( parent.send(attribute.association.name) ).sum(attribute.arel_field)
|
|
24
|
+
val = attribute.attribute.add_join( parent.send(attribute.association.name) ).sum(attribute.arel_field)
|
|
25
|
+
val = BigDecimal.new(val.to_s) unless val.is_a?(BigDecimal)
|
|
26
|
+
val
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
end
|
|
@@ -23,11 +23,11 @@ module AzaharaSchema
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def visibility_scope!(ability, authorization_action=:index)
|
|
26
|
-
@
|
|
26
|
+
@base_scope = base_scope.accessible_by(ability, authorization_action)
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
-
def
|
|
30
|
-
@
|
|
29
|
+
def base_scope
|
|
30
|
+
@base_scope || super
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
# dummy implementations for rewrite
|
|
@@ -243,8 +243,12 @@ module AzaharaSchema
|
|
|
243
243
|
query.split if query
|
|
244
244
|
end
|
|
245
245
|
|
|
246
|
-
def
|
|
247
|
-
|
|
246
|
+
def base_scope
|
|
247
|
+
model.all
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def entity_scope(scope=base_scope)
|
|
251
|
+
scope = scope.visible if scope.respond_to?(:visible)
|
|
248
252
|
scope = scope.send(self.default_scope) if self.default_scope
|
|
249
253
|
scope
|
|
250
254
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: azahara_schema
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.11
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ondřej Ezr
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-07-
|
|
11
|
+
date: 2018-07-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|