arel_extensions 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4aedfa89fd11432debf6ba61fb1e886d8f28eb7a294c997576726d9e37ca4686
4
- data.tar.gz: 311b54b4b82336dcc62ac4b2637594219a9247f0a46f0b17d085670244e62a6b
3
+ metadata.gz: 496c28c87b9cb589cdb380689e61b9342a133810c6b1bae0800a47de8af1a36f
4
+ data.tar.gz: 78f60edcc7cbe904d7fe426b93713a0718e0303316512e04add8b22324e1c8d7
5
5
  SHA512:
6
- metadata.gz: e218dc06b3c421472981e4a97db46bfdd29f1cf2ec9c4e0af1504032d604b542ed2c02bb97e5ea61e361f09f8c3726c34b07bfa7eeeb519728284a829d3c9978
7
- data.tar.gz: fdb8f5763e31fd9c8aa59f66b95b2b2700049ecc0ee544d1f8880b659e0c48e6a6e091ee9788cd99f59a6d57c7d47b27140a4e64025add61c2697e17358d9ede
6
+ metadata.gz: 78e2a4bb36148b6ad53963c18e66dc3b17ebf992b4d87cbf42257a50160072ae39c9bbb700fc22dc19adb4b6a7e0add1f011ef27608004f16a4e737bbd2e5afe
7
+ data.tar.gz: 7951d173223ebea2e46a745110c9b892f0d3c6e36c775d2b92d5e926504e79a44fc400078b6861a526781fa0b0c783b6a3061e8bd4b805fc608117a30ac2dac6
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## [unreleased]
4
+
5
+ ## Release v2.2.1/v1.4.1 (08-11-2024)
6
+
7
+ - Improved deprecartion warnings for `==` and `!=`, showing the location where they're called.
8
+
3
9
  ## Release v2.2.0/v1.4.0
4
10
 
5
11
  - MS SQL: restrict date-quoting to Arel <= 6 (Rails 4.2)
@@ -23,7 +23,7 @@ module ArelExtensions
23
23
 
24
24
  def ==(other)
25
25
  if Gem::Version.create(ArelExtensions::VERSION) >= Gem::Version.create('2.2') && @@warn_eqeq
26
- warn('arel_extensions: `==` is now deprecated and will be removed soon. Use `.eq` instead.')
26
+ warn("[#{caller(0..0)[0]}] arel_extensions: `==` is now deprecated and will be removed soon. Use `.eq` instead.")
27
27
  @@warn_eqeq = false
28
28
  end
29
29
  Arel::Nodes::Equality.new self, Arel.quoted(other, self)
@@ -31,7 +31,7 @@ module ArelExtensions
31
31
 
32
32
  def !=(other)
33
33
  if Gem::Version.create(ArelExtensions::VERSION) >= Gem::Version.create('2.2') && @@warn_noteq
34
- warn('arel_extensions: `!=` is now deprecated and will be removed soon. Use `.not_eq` instead.')
34
+ warn("[#{caller(0..0)[0]}] arel_extensions: `!=` is now deprecated and will be removed soon. Use `.not_eq` instead.")
35
35
  @@warn_noteq = false
36
36
  end
37
37
  Arel::Nodes::NotEqual.new self, Arel.quoted(other, self)
@@ -1,3 +1,3 @@
1
1
  module ArelExtensions
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  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 = Time.now.month == 5 ? 10 : 9
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
- assert_equal 0, User.where(@created_at.day.eq('05')).count
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
@@ -1,3 +1,3 @@
1
1
  module ArelExtensions
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  end
data/version_v2.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module ArelExtensions
2
- VERSION = '2.2.0'.freeze
2
+ VERSION = '2.2.1'.freeze
3
3
  end
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: 2.2.0
4
+ version: 2.2.1
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-08-22 00:00:00.000000000 Z
13
+ date: 2024-11-08 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord