forest_admin_datasource_toolkit 1.0.0.pre.beta.26 → 1.0.0.pre.beta.27
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: da476de3594dde88a2fba472ab9c95f835ff430aafb566000101721183462777
|
4
|
+
data.tar.gz: ccc40eae51cf545e43c357181f2dde06ed6b3bf3473d97c8029c0f9a588d5738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2c1918f8da7f4ebcbcd377591e63224fedd85e8e039dae2b3874599b8869cdec57052e117013762bfa5ddc8d7749c3d7b6826bd7eb46476d4616683b7e3abe02
|
7
|
+
data.tar.gz: c6fb011db51fcdb3f10bf8724d0fd403860b0c46862d73129514d746524c5e85a1e3183f3b95d055ea729d022ea8d7f46f10fac45f500e504bde9d7ad68e273d
|
@@ -9,9 +9,6 @@ module ForestAdminDatasourceToolkit
|
|
9
9
|
:schema,
|
10
10
|
:native_driver
|
11
11
|
|
12
|
-
attr_writer :searchable,
|
13
|
-
:countable
|
14
|
-
|
15
12
|
def initialize(datasource, name, native_driver: nil)
|
16
13
|
super()
|
17
14
|
@datasource = datasource
|
@@ -19,35 +16,34 @@ module ForestAdminDatasourceToolkit
|
|
19
16
|
@native_driver = native_driver
|
20
17
|
@schema = {
|
21
18
|
fields: {},
|
22
|
-
countable: false
|
19
|
+
countable: false,
|
20
|
+
searchable: false
|
23
21
|
}
|
24
22
|
@actions = {}
|
25
23
|
@segments = {}
|
26
24
|
@charts = {}
|
27
|
-
@searchable = false
|
28
|
-
@countable = false
|
29
25
|
end
|
30
26
|
|
31
27
|
def enable_count
|
32
|
-
|
28
|
+
schema[:countable] = true
|
33
29
|
end
|
34
30
|
|
35
31
|
def is_countable?
|
36
|
-
|
32
|
+
schema[:countable]
|
37
33
|
end
|
38
34
|
|
39
35
|
def is_searchable?
|
40
|
-
|
36
|
+
schema[:searchable]
|
41
37
|
end
|
42
38
|
|
43
39
|
def fields
|
44
|
-
|
40
|
+
schema[:fields]
|
45
41
|
end
|
46
42
|
|
47
43
|
def add_field(name, field)
|
48
44
|
raise Exceptions::ForestException, "Field #{name} already defined in collection" if @schema[:fields].key?(name)
|
49
45
|
|
50
|
-
|
46
|
+
schema[:fields][name] = field
|
51
47
|
end
|
52
48
|
|
53
49
|
def add_fields(fields)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: forest_admin_datasource_toolkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.pre.beta.
|
4
|
+
version: 1.0.0.pre.beta.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthieu
|
@@ -84,7 +84,6 @@ files:
|
|
84
84
|
- lib/forest_admin_datasource_toolkit/datasource.rb
|
85
85
|
- lib/forest_admin_datasource_toolkit/decorators/collection_decorator.rb
|
86
86
|
- lib/forest_admin_datasource_toolkit/decorators/datasource_decorator.rb
|
87
|
-
- lib/forest_admin_datasource_toolkit/decorators/schema/schema_collection_decorator.rb
|
88
87
|
- lib/forest_admin_datasource_toolkit/exceptions/forest_exception.rb
|
89
88
|
- lib/forest_admin_datasource_toolkit/schema/column_schema.rb
|
90
89
|
- lib/forest_admin_datasource_toolkit/schema/primitive_type.rb
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module ForestAdminDatasourceToolkit
|
2
|
-
module Decorators
|
3
|
-
module Schema
|
4
|
-
class SchemaCollectionDecorator < CollectionDecorator
|
5
|
-
def initialize(child_collection, datasource)
|
6
|
-
super
|
7
|
-
@schema_override = {}
|
8
|
-
end
|
9
|
-
|
10
|
-
def override_schema(value)
|
11
|
-
@schema_override.merge!(value)
|
12
|
-
mark_schema_as_dirty
|
13
|
-
end
|
14
|
-
|
15
|
-
def refine_schema(sub_schema)
|
16
|
-
sub_schema.merge(@schema_override)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|