created_id 1.0.0 → 1.0.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/CHANGELOG.md +6 -0
- data/README.md +2 -0
- data/VERSION +1 -1
- data/lib/created_id/engine.rb +0 -3
- data/lib/created_id.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be6ec5c9e09c606d38aafaedc55cc820060d1a7eb40461b72be62a820463d482
|
4
|
+
data.tar.gz: 3c8a7be82f5aa0ba954b1f649aa634432c6b97d0f196d29adb09be069e7c68b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a74a5207fda30568768be24de8b55f1554ebe09f157f5d42f00ceda243e6028e6570da3dbdedba713058b65a7f1416c2438d122f4f5bd84c455fb2d7d6418eba
|
7
|
+
data.tar.gz: 5b02e4a9f71f2bc5306a49ff56de89f011d829a4972b00240592532a0de390d7a097babadfabec861e93ed2d1acee085a3be5020d397b23331c08b8288e1e576
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
+
## 1.0.1
|
8
|
+
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
- Standardize lazy loading of models.
|
12
|
+
|
7
13
|
## 1.0.0
|
8
14
|
|
9
15
|
### Added
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Created ID
|
2
2
|
|
3
3
|
[](https://github.com/bdurand/created_id/actions/workflows/continuous_integration.yml)
|
4
|
+
[](https://github.com/bdurand/created_id/actions/workflows/regression_test.yml)
|
4
5
|
[](https://github.com/testdouble/standard)
|
6
|
+
[](https://badge.fury.io/rb/created_id)
|
5
7
|
|
6
8
|
The gem is designed to optimize queries for ActiveRecord models that filter by the `created_at` timestamp. It can make queries more efficient by pre-calculating the ranges of id's for specific dates.
|
7
9
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.1
|
data/lib/created_id/engine.rb
CHANGED
data/lib/created_id.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require_relative "created_id/version"
|
4
3
|
require_relative "created_id/engine" if defined?(Rails::Engine)
|
5
4
|
|
6
5
|
module CreatedId
|
7
6
|
extend ActiveSupport::Concern
|
7
|
+
|
8
|
+
autoload :IdRange, "created_id/id_range"
|
9
|
+
autoload :VERSION, "created_id/version"
|
10
|
+
|
8
11
|
class CreatedAtChangedError < StandardError
|
9
12
|
end
|
10
13
|
|
@@ -21,9 +24,6 @@ module CreatedId
|
|
21
24
|
raise ArgmentError, "CreatedId can only be included in ActiveRecord models"
|
22
25
|
end
|
23
26
|
|
24
|
-
# Require here so we don't mess up loading the activerecord gem.
|
25
|
-
require_relative "created_id/id_range"
|
26
|
-
|
27
27
|
scope :created_after, ->(time) { where(arel_table[:created_at].gteq(time).and(arel_table[primary_key].gteq(CreatedId::IdRange.min_id(self, time)))) }
|
28
28
|
scope :created_before, ->(time) { where(arel_table[:created_at].lt(time).and(arel_table[primary_key].lteq(CreatedId::IdRange.max_id(self, time)))) }
|
29
29
|
scope :created_between, ->(time_1, time_2) { created_after(time_1).created_before(time_2) }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: created_id
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Durand
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|