temporal_scopes 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: a0bb59fb20ec57703464efa1db45f23340de3450
4
- data.tar.gz: baeec6001c3138410bd94561be1339292948b4fb
3
+ metadata.gz: 94a3e4d044e19b17f047f05119b5d8b314d10b9c
4
+ data.tar.gz: 9a278b03a99885399eeb0a4709688cec3213ffa3
5
5
  SHA512:
6
- metadata.gz: 3936bb8540a87a2f6aff81483a0e6ee5e3fa623466bb5c7c426097342280e74add1ff5b92b66c14c95f99b114d077ebade22b186b106ff7d27560c7c7cdc4c51
7
- data.tar.gz: ff2003aff6d0c39d4a0fef33490dc95e73da1d2a062596b60ba6fb74e9d3c8f9c597626f2c10c457b2bf9efaee8711848c35ebb5454433b5542e8c1a312796d3
6
+ metadata.gz: 71371629285a9090a909584c8e9cd709b4dc02423dec61b91ff603c9cfbbfe191d4ee31fdad52990525afa3b04bc4a9b0b1a27de4db03d42acdb9562f7bf5817
7
+ data.tar.gz: 2627721842d4d74837c9e93a72316c0a6bf13c6c78f28b6582e04e60b01dd5583b7833e14bcf0f4037a17d0191084e9590b8fab16796eb2392922c81ce4a339f
@@ -58,8 +58,10 @@ module TemporalScopes
58
58
  # @return [ActiveRecord::Relation] the relation without temporal conditions on `valid_from` and `valid_to`.
59
59
  #
60
60
  def without_temporal_condition
61
- relation = unscope(where: [:valid_from, :valid_to])
62
- relation.where_values.delete_if { |query| query.to_sql.include?("\"valid_from\"") || query.to_sql.include?("\"valid_to\"") } if relation && relation.where_values
61
+ relation = rewhere(valid_from: nil, valid_to: nil)
62
+ relation.where_values.delete_if { |query|
63
+ query.to_sql.include?("\"valid_from\"") || query.to_sql.include?("\"valid_to\"")
64
+ }
63
65
  relation
64
66
  end
65
67
 
@@ -1,3 +1,3 @@
1
1
  module TemporalScopes
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: temporal_scopes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Fiedlschuster