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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c53b92c8429982b7cd9b1ccda2da10691ed90b9595110e8ee7ec014fe5a6904c
4
- data.tar.gz: 25a94e545f17cbdaa62a1213fef716e214520917d57cf4ed39c027ef03164aef
3
+ metadata.gz: 360672c160e4003725870af0c59a49f398241b542e345198e96ff6fca398e451
4
+ data.tar.gz: b3f0b90b6b53c3e3f6c755dbb76ee4bd1f5ceb3e6d3918bb5a66b9eb6528272a
5
5
  SHA512:
6
- metadata.gz: 44d0609cab2c4abe3586e42c8e8ab64a0f222b903c40d26880265354e7f026ee548c953df48e2c062aded068475409034eee8dbada75cdb053af689417c91c02
7
- data.tar.gz: e15587e0faf44a8bd097894ea166067634115cdcab08565dcf78b3357d9c255e974372eb1032af705f29a59e674d87ba961ea0de613d4333601b70a89adabeae
6
+ metadata.gz: 50c956cb713851120a4e07d91328174124f45e1ef812fe1d8d128b2cd6715fc12ec3358b1db9d52e1fbbb18a0af825bc92687c138b504cebbce1d680f088223e
7
+ data.tar.gz: 4a7ad6ef5251a29547b2c9e72bcc9447a33aa88af51ec34ba07b226b1d1aec737e2c1d28dd7f7c339f91de089e014e4fa6eea01b528f452234ab5a364d721f8a
data/.gitignore CHANGED
@@ -6,6 +6,6 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
-
9
+ /Gemfile.lock
10
10
  # rspec failure tracking
11
11
  .rspec_status
data/README.md CHANGED
@@ -22,7 +22,18 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
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]}"
@@ -1,3 +1,3 @@
1
1
  module RailsElasticSensitivity
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_elastic_sensitivity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - fifiten82726