arel_extensions 1.4.0 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/NEWS.md +11 -0
- data/lib/arel_extensions/attributes.rb +4 -9
- data/lib/arel_extensions/version.rb +1 -1
- data/test/with_ar/all_agnostic_test.rb +4 -2
- data/version_v1.rb +1 -1
- data/version_v2.rb +1 -1
- 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: 0575b4ab47af8476483e318be8f31d527f5c8a2647252ae8ce8ee7c4ca76dd0e
|
4
|
+
data.tar.gz: aade085eaa75d84970e2f7ddfa94a065f783780a8175000c5de8d4276ef097d1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2e8b3d5bfe158426a8f9bc52ce9923c36255cb66b5573fe42a95adf5cd10a0f8a03ba946fec5d474296bd3873328f2976fc25bf8bce18b8029cc4a541db591da
|
7
|
+
data.tar.gz: 3881eb2b0badf280a8a0b503539d37295bcd004d0636c2df1f5639cb67197ce22719e08a5311cd44a54871d222d6e5e74d0350b773da8a6ff9bcdb7451a1799a
|
data/NEWS.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# News
|
2
2
|
|
3
|
+
## [unreleased]
|
4
|
+
|
5
|
+
## Release v2.2.2/v1.4.2 (27-11-2024)
|
6
|
+
|
7
|
+
- Fix deprecartion warnings for `==` and `!=`, showing the true location.
|
8
|
+
- Always emit deprecartion warnings for `==` and `!=`.
|
9
|
+
|
10
|
+
## Release v2.2.1/v1.4.1 (08-11-2024)
|
11
|
+
|
12
|
+
- Improved deprecartion warnings for `==` and `!=`, showing the location where they're called.
|
13
|
+
|
3
14
|
## Release v2.2.0/v1.4.0
|
4
15
|
|
5
16
|
- MS SQL: restrict date-quoting to Arel <= 6 (Rails 4.2)
|
@@ -18,21 +18,16 @@ module ArelExtensions
|
|
18
18
|
include ArelExtensions::StringFunctions
|
19
19
|
include ArelExtensions::Predications
|
20
20
|
|
21
|
-
@@warn_eqeq = true
|
22
|
-
@@warn_noteq = true
|
23
|
-
|
24
21
|
def ==(other)
|
25
|
-
if Gem::Version.create(ArelExtensions::VERSION) >= Gem::Version.create('2.2')
|
26
|
-
warn(
|
27
|
-
@@warn_eqeq = false
|
22
|
+
if Gem::Version.create(ArelExtensions::VERSION) >= Gem::Version.create('2.2')
|
23
|
+
warn("#{caller(1..1).first} arel_extensions: `==` is now deprecated and will be removed soon. Use `.eq` instead.")
|
28
24
|
end
|
29
25
|
Arel::Nodes::Equality.new self, Arel.quoted(other, self)
|
30
26
|
end
|
31
27
|
|
32
28
|
def !=(other)
|
33
|
-
if Gem::Version.create(ArelExtensions::VERSION) >= Gem::Version.create('2.2')
|
34
|
-
warn(
|
35
|
-
@@warn_noteq = false
|
29
|
+
if Gem::Version.create(ArelExtensions::VERSION) >= Gem::Version.create('2.2')
|
30
|
+
warn("#{caller(1..1).first} arel_extensions: `!=` is now deprecated and will be removed soon. Use `.not_eq` instead.")
|
36
31
|
end
|
37
32
|
Arel::Nodes::NotEqual.new self, Arel.quoted(other, self)
|
38
33
|
end
|
@@ -679,7 +679,8 @@ module ArelExtensions
|
|
679
679
|
#
|
680
680
|
# So depending on the month when we run this test, we will get different
|
681
681
|
# results for `User.where(@created_at.month.eq('05'))`.
|
682
|
-
count_for_may =
|
682
|
+
count_for_may = Date.today.month == 5 ? 10 : 9
|
683
|
+
count_for_day = Date.today.day == 5 ? 1 : 0
|
683
684
|
|
684
685
|
# Year
|
685
686
|
assert_equal 2016, t(@lucas, @created_at.year).to_i
|
@@ -692,7 +693,8 @@ module ArelExtensions
|
|
692
693
|
assert_equal count_for_may, User.where(@created_at.month.eq('05')).count
|
693
694
|
# Day
|
694
695
|
assert_equal 23, t(@laure, @created_at.day).to_i
|
695
|
-
|
696
|
+
# Make sure we get the correct count on the date we run the test.
|
697
|
+
assert_equal count_for_day, User.where(@created_at.day.eq('05')).count
|
696
698
|
|
697
699
|
# skip "manage DATE" if @env_db == 'oracle'
|
698
700
|
# Hour
|
data/version_v1.rb
CHANGED
data/version_v2.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arel_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yann Azoury
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2024-
|
13
|
+
date: 2024-11-27 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: arel
|