azahara_schema 0.3.2 → 0.3.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cbcc60cb930db0856a0b272a556e1e5c26104f3d7d0034b069898cc638271f81
4
- data.tar.gz: cbc108bfbf03eec4893f1ccf54ee81193f5482ff3c89f9dffa8a3c7c46d86a62
3
+ metadata.gz: 10b335d3ec510ba75c370ef57465b556b0677a701ccf48b0ac4897caa69badde
4
+ data.tar.gz: c19c73e6b9b01aa4a4d391b0f95e0c4a93789864fb8a07f8bb1707b4261d278b
5
5
  SHA512:
6
- metadata.gz: 4221ea1d965bd950d2cd58580a3031581cd8b6d5dc17ed5afc959b32fad061d1fea05b9d9dd2be99144873565710a32e56b71e095d0eebfde2fecdb08e1f0651
7
- data.tar.gz: ae2806c220f03f5164a98d1f86e4399060bd11c09643a29c867c9967a01ea9b199378b8f1d976308a6b0626718fba78b34b60bafaec7aea05430b06947f372a7
6
+ metadata.gz: e1fc19074a8cf5e26fcc158788c1575fedc278d5809a8556f9878cc1a08c30a65565ef49f579b0696d1eb19e31db060cdc91d7dd80a937bd58b34fb92dd78d4b
7
+ data.tar.gz: 4a663f5fb26982a963eb503d0cb1dad1357152a92181ab78b95ae8f6c785fcd6c50fadc047072d8c7257435f4a199ef617a9755140f4a6f226ecd2e3b9bb065c
@@ -0,0 +1,19 @@
1
+ module Arel
2
+ module Predications
3
+ def contains(right)
4
+ Arel::Nodes::Contains.new(self, quoted_node(right))
5
+ end
6
+ end
7
+
8
+ class Nodes::Contains < Nodes::Binary
9
+ def operator; :"@>" end
10
+ end
11
+
12
+ class Visitors::PostgreSQL
13
+ private
14
+ def visit_Arel_Nodes_Contains o, collector
15
+ infix_value o, collector, " #{Nodes::Contains.new(nil, nil).operator} "
16
+ end
17
+ end
18
+
19
+ end
@@ -92,6 +92,9 @@ module AzaharaSchema
92
92
  arel_field.gteq(values.map(&:to_f).min)
93
93
  when '<='
94
94
  arel_field.lteq(values.map(&:to_f).max)
95
+ when '@>'
96
+ require 'arel/azahara_postgres_exts'
97
+ arel_field.contains(values)
95
98
  else
96
99
  throw 'Unknown operator ' + operator.to_s
97
100
  end
@@ -32,11 +32,11 @@ module AzaharaSchema
32
32
 
33
33
  # dummy implementations for rewrite
34
34
  def uncollapsable_filters
35
- available_filters.select{|name, filter| always_visible_filters.include?(name) }
35
+ user_available_filters.select{|name, filter| always_visible_filters.include?(name) }
36
36
  end
37
37
 
38
38
  def collapsable_filters
39
- available_filters.select{|name, filter| !always_visible_filters.include?(name) }
39
+ user_available_filters.select{|name, filter| !always_visible_filters.include?(name) }
40
40
  end
41
41
 
42
42
  # rendering
@@ -192,7 +192,11 @@ module AzaharaSchema
192
192
  end
193
193
 
194
194
  def available_filters
195
- @available_filters ||= available_attributes_hash.slice(*enabled_filter_names)
195
+ @available_filters ||= available_attributes_hash
196
+ end
197
+
198
+ def user_available_filters
199
+ available_filters.slice(*enabled_filter_names)
196
200
  end
197
201
 
198
202
  def association_path
@@ -1,3 +1,3 @@
1
1
  module AzaharaSchema
2
- VERSION = '0.3.2'
2
+ VERSION = '0.3.3'
3
3
  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.2
4
+ version: 0.3.3
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-06 00:00:00.000000000 Z
11
+ date: 2018-04-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -66,6 +66,7 @@ files:
66
66
  - app/views/layouts/action_schema/application.html.erb
67
67
  - config/locales/cs.yml
68
68
  - config/routes.rb
69
+ - lib/arel/azahara_postgres_exts.rb
69
70
  - lib/azahara_schema.rb
70
71
  - lib/azahara_schema/aggregation_attribute.rb
71
72
  - lib/azahara_schema/association_attribute.rb