fast_exists 1.0.1 → 1.0.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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 840f9908c74f299c03604a5315216b3cf7989df4ee8d36c3a4c882fe15e80746
|
|
4
|
+
data.tar.gz: ed3cf8169f01be4892df5c488232c94328aeed83296680ff1ec524e7758dd65f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b335f6b7675f78ccefdca3ab1456b50808a01bcbfae31501affe6572fe41d3ef0199de4a12ef55e955ba0b2595a86b172f1e2c3306585fd5d9fcc89e2d3a3c44
|
|
7
|
+
data.tar.gz: 9a6c90ff0c7abf9e614c3a658f4db46d483881d2cf0fa954280290b03ed153c00751879f89cbc811713f42a0af6d499df6626147db85e90e51dfb2afaade864d
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
> **Ultra-Fast Existence Checks in Ruby on Rails Using Probabilistic Data Structures**
|
|
4
4
|
|
|
5
5
|
[](https://github.com/nirazan1/fast_exists/actions)
|
|
6
|
-
[](https://github.com/nirazan1/fast_exists/releases)
|
|
7
7
|
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
|
|
9
9
|
**FastExists** is a production-ready Ruby gem that drastically reduces unnecessary database queries in Ruby on Rails applications by evaluating existence checks against ultra-fast, thread-safe probabilistic data structures (Bloom Filters, Scalable Bloom Filters, Cuckoo Filters, HyperLogLog) while **keeping the database as the single source of truth**.
|
|
@@ -42,14 +42,14 @@ High-volume Rails applications handle millions or billions of existence checks w
|
|
|
42
42
|
|
|
43
43
|
## 📦 Installation
|
|
44
44
|
|
|
45
|
-
Add `fast_exists` (latest version **v1.0.
|
|
45
|
+
Add `fast_exists` (latest version **v1.0.3**) to your Gemfile:
|
|
46
46
|
|
|
47
47
|
```ruby
|
|
48
48
|
# From RubyGems
|
|
49
|
-
gem "fast_exists", "~> 1.0.
|
|
49
|
+
gem "fast_exists", "~> 1.0.3"
|
|
50
50
|
|
|
51
51
|
# Or directly from GitHub repository
|
|
52
|
-
gem "fast_exists", git: "https://github.com/nirazan1/fast_exists.git", tag: "v1.0.
|
|
52
|
+
gem "fast_exists", git: "https://github.com/nirazan1/fast_exists.git", tag: "v1.0.3"
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
Then run:
|
|
@@ -36,12 +36,12 @@ module FastExists
|
|
|
36
36
|
private
|
|
37
37
|
|
|
38
38
|
def determine_models(target, models)
|
|
39
|
-
if target.is_a?(Class) && target < ActiveRecord::Base
|
|
39
|
+
if target.is_a?(Class) && defined?(::ActiveRecord::Base) && target < ::ActiveRecord::Base
|
|
40
40
|
[target]
|
|
41
41
|
elsif models.is_a?(Array)
|
|
42
42
|
models.compact
|
|
43
|
-
elsif defined?(ActiveRecord::Base)
|
|
44
|
-
ActiveRecord::Base.descendants.reject(&:abstract_class?)
|
|
43
|
+
elsif defined?(::ActiveRecord::Base)
|
|
44
|
+
::ActiveRecord::Base.descendants.reject(&:abstract_class?)
|
|
45
45
|
else
|
|
46
46
|
[]
|
|
47
47
|
end
|
|
@@ -127,7 +127,7 @@ module FastExists
|
|
|
127
127
|
{
|
|
128
128
|
ruby_version: RUBY_VERSION,
|
|
129
129
|
rails_version: defined?(Rails) && Rails.respond_to?(:version) ? Rails.version : "N/A",
|
|
130
|
-
database: defined?(ActiveRecord::Base) ? (ActiveRecord::Base.connection_db_config.adapter rescue "sqlite3") : "N/A"
|
|
130
|
+
database: defined?(::ActiveRecord::Base) ? (::ActiveRecord::Base.connection_db_config.adapter rescue "sqlite3") : "N/A"
|
|
131
131
|
}
|
|
132
132
|
end
|
|
133
133
|
end
|
|
@@ -11,8 +11,8 @@ module FastExists
|
|
|
11
11
|
findings = []
|
|
12
12
|
|
|
13
13
|
# 1. Inspect ActiveRecord Models & Indexes
|
|
14
|
-
if defined?(ActiveRecord::Base)
|
|
15
|
-
ActiveRecord::Base.descendants.reject(&:abstract_class?).each do |klass|
|
|
14
|
+
if defined?(::ActiveRecord::Base)
|
|
15
|
+
::ActiveRecord::Base.descendants.reject(&:abstract_class?).each do |klass|
|
|
16
16
|
next unless klass.respond_to?(:table_exists?) && klass.table_exists?
|
|
17
17
|
inspect_model(klass, findings)
|
|
18
18
|
end
|
|
@@ -45,7 +45,7 @@ module FastExists
|
|
|
45
45
|
ruby_version: RUBY_VERSION,
|
|
46
46
|
ruby_platform: RUBY_PLATFORM,
|
|
47
47
|
rails_version: defined?(Rails) && Rails.respond_to?(:version) ? Rails.version : "N/A",
|
|
48
|
-
database_adapter: defined?(ActiveRecord::Base) ? (ActiveRecord::Base.connection_db_config.adapter rescue "sqlite3") : "N/A",
|
|
48
|
+
database_adapter: defined?(::ActiveRecord::Base) ? (::ActiveRecord::Base.connection_db_config.adapter rescue "sqlite3") : "N/A",
|
|
49
49
|
backend: FastExists.configuration.backend.to_s,
|
|
50
50
|
auto_sync: FastExists.configuration.auto_sync,
|
|
51
51
|
instrumentation: FastExists.configuration.instrumentation,
|
data/lib/fast_exists/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fast_exists
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- FastExists Team
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-07-
|
|
10
|
+
date: 2026-07-30 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activesupport
|