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: 9749205ecd01ce84b131e59b25235bd4555bd5bb64ec5620d283bc46ab51ebb3
4
- data.tar.gz: 474671b8aa198bd1a2cbb1b0c95e95bab9e2275572344990376aa37d1b3773ef
3
+ metadata.gz: da476de3594dde88a2fba472ab9c95f835ff430aafb566000101721183462777
4
+ data.tar.gz: ccc40eae51cf545e43c357181f2dde06ed6b3bf3473d97c8029c0f9a588d5738
5
5
  SHA512:
6
- metadata.gz: f7d84033214299dbcec6ce24d8d20a538de1895dca6349ef5b32c9cbf3744df3df3994a5cb10263055a4f8ac30c160756595a80c6b1088e100f25d389e3b4732
7
- data.tar.gz: da6e1e8ead04fab78151c72117a73d89c0b4665df2c1c10c16b130fe9e492ab0ca5ec7b9b552343b8e5b90a99dbd5469a4da761d4d90ac24a753f42399e3ba2f
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
- @schema[:countable] = true
28
+ schema[:countable] = true
33
29
  end
34
30
 
35
31
  def is_countable?
36
- @schema[:countable]
32
+ schema[:countable]
37
33
  end
38
34
 
39
35
  def is_searchable?
40
- @searchable
36
+ schema[:searchable]
41
37
  end
42
38
 
43
39
  def fields
44
- @schema[:fields]
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
- @schema[:fields][name] = field
46
+ schema[:fields][name] = field
51
47
  end
52
48
 
53
49
  def add_fields(fields)
@@ -1,3 +1,3 @@
1
1
  module ForestAdminDatasourceToolkit
2
- VERSION = "1.0.0-beta.26"
2
+ VERSION = "1.0.0-beta.27"
3
3
  end
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.26
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