azahara_schema 0.3.4 → 0.3.5
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f94ff9042c2246d38dbfabfc0b4935c0e3e187cdee2a98f23bf6f37c25b4defa
|
4
|
+
data.tar.gz: 301ab4cbe1764857c16f9c26e69e607a2bac6c5be3ee335e9cd7ec63ca8c426b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a72b9632ec5e74ff694b679fcd37dbee464dbf37300941a52b4c55312055b8bbaee54c3e2dd9f1fe2527c414f53c09dbacee7ff834528a0f99ea46b70101139
|
7
|
+
data.tar.gz: 5ada7cf0f14f608d304bd7f1b6a93baa6ea7d19d76ad287486b42445251507b037ac92a26e90bb2a88ebb3878c9e509ca76f665dc20cb32233fc847a82b5bdef
|
@@ -60,11 +60,11 @@ module AzaharaSchema
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def formatted_value(attribute, entity, **options)
|
63
|
-
real_formatter(attribute).format_value(attribute, attribute_human_value(attribute, entity), options)
|
63
|
+
real_formatter(attribute).format_value(attribute, attribute_human_value(attribute, entity), formatting_options(attribute,entity).merge(options))
|
64
64
|
end
|
65
65
|
|
66
66
|
def html_formatted_value(attribute, entity, **options)
|
67
|
-
format_value_html(attribute, attribute.value(entity), options)
|
67
|
+
format_value_html(attribute, attribute.value(entity), formatting_options(attribute,entity).merge(options))
|
68
68
|
end
|
69
69
|
|
70
70
|
def attribute_html_label(attribute, **options)
|
@@ -94,6 +94,10 @@ module AzaharaSchema
|
|
94
94
|
formated_value = real_formatter(attribute).format_value(attribute, unformated_value, options)
|
95
95
|
end
|
96
96
|
|
97
|
+
def formatting_options(attribute, entity)
|
98
|
+
{}
|
99
|
+
end
|
100
|
+
|
97
101
|
def real_formatter(attribute)
|
98
102
|
if attribute.respond_to?(:attribute)
|
99
103
|
self.class.formatter_for(attribute.attribute.model).new(attribute.attribute.model, template, @options).real_formatter(attribute.attribute)
|
@@ -243,7 +243,7 @@ module AzaharaSchema
|
|
243
243
|
|
244
244
|
def entity_scope
|
245
245
|
scope = model.respond_to?(:visible) ? model.visible : model.all
|
246
|
-
scope.send(self.default_scope) if self.default_scope
|
246
|
+
scope = scope.send(self.default_scope) if self.default_scope
|
247
247
|
scope
|
248
248
|
end
|
249
249
|
|
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.5
|
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-04-
|
11
|
+
date: 2018-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|