rails_elastic_sensitivity 0.1.0 → 0.1.1
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/.gitignore +1 -1
- data/README.md +12 -1
- data/lib/rails_elastic_sensitivity.rb +1 -8
- data/lib/rails_elastic_sensitivity/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 360672c160e4003725870af0c59a49f398241b542e345198e96ff6fca398e451
|
4
|
+
data.tar.gz: b3f0b90b6b53c3e3f6c755dbb76ee4bd1f5ceb3e6d3918bb5a66b9eb6528272a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50c956cb713851120a4e07d91328174124f45e1ef812fe1d8d128b2cd6715fc12ec3358b1db9d52e1fbbb18a0af825bc92687c138b504cebbce1d680f088223e
|
7
|
+
data.tar.gz: 4a7ad6ef5251a29547b2c9e72bcc9447a33aa88af51ec34ba07b226b1d1aec737e2c1d28dd7f7c339f91de089e014e4fa6eea01b528f452234ab5a364d721f8a
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -22,7 +22,18 @@ Or install it yourself as:
|
|
22
22
|
|
23
23
|
## Usage
|
24
24
|
|
25
|
-
|
25
|
+
Example:
|
26
|
+
|
27
|
+
```rb
|
28
|
+
# Create Instance
|
29
|
+
es = ElaticSensitivity.new(:user)
|
30
|
+
|
31
|
+
# See true query result
|
32
|
+
es.joins(:gamecharacters).where(gamecharacters: {course_id: 100}).count
|
33
|
+
|
34
|
+
# See query result with elastic sensitivity mechanism
|
35
|
+
es.joins(:gamecharacters).where(gamecharacters: {course_id: 100}).elastic_count
|
36
|
+
```
|
26
37
|
|
27
38
|
## Development
|
28
39
|
|
@@ -3,6 +3,7 @@ require 'active_record'
|
|
3
3
|
|
4
4
|
class ElaticSensitivity
|
5
5
|
attr_accessor :main_t, :elastic_sensitivity, :epi, :k, :c, :k_square, :cache_mfx_table
|
6
|
+
alias_method :mfx, :precompute_mfx
|
6
7
|
|
7
8
|
def initialize(table)
|
8
9
|
@cache_mfx_table = {}
|
@@ -68,14 +69,6 @@ class ElaticSensitivity
|
|
68
69
|
@main_t.joins(joins_t)
|
69
70
|
end
|
70
71
|
|
71
|
-
def mfx(attribute, table)
|
72
|
-
|
73
|
-
end
|
74
|
-
|
75
|
-
def compute_elastic_sensitivity(c, k, k_square)
|
76
|
-
|
77
|
-
end
|
78
|
-
|
79
72
|
def compute_constant(precompute_params)
|
80
73
|
precompute_params.map do |ps|
|
81
74
|
key = "#{ps[1]}_#{ps[0]}"
|