active_windows 0.1.3 → 0.1.4

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: 40d81b47d0bf35406b6d9004f3eb82b0137b3bfc0dc5bed7e2d33b697753aeae
4
- data.tar.gz: 11897b5353a3c8b993922c7af8a4819964d417640bce9501182b145750051144
3
+ metadata.gz: 2b6484d037d47f4cfa292310a435491c37b03c15921159e34df31e6d69972f9f
4
+ data.tar.gz: 20ec937b0f30935c9d2775508c4a22e75edaa791b0e4ad4ce51bced086efa512
5
5
  SHA512:
6
- metadata.gz: 3b858116cd6290e77e23c5688336102efd83a234bb2caca193728e9b9458a91591fe0653420f5cc400238603921f86e472d3d92ab4028342e4ad9eb2396b4d2e
7
- data.tar.gz: 3974f6c3a73e2efbbb6aeb603c2ab4ddfd65a88eb23d10353fe94ef50746f38fc4c5c7abceec862f2eb53e8b26f710d3a7b9e274f3889132d83c48874d984e3d
6
+ metadata.gz: 5abfc8d5ca03ab4bd1c8ef3f76c0919b9b4dce21b2d576ad1650d0bebc870c9f29c6944441560bed1c6a73fe3742ae7adfa25f9d6439e66723e759fa07890a1a
7
+ data.tar.gz: 6b195b1e5afb8b55b641208c9ebb9540b329d9a0f2de18e33ec3dcfd17acb85bf15d461bde3cb004261744289c253a8ea033311c0d3ec1edab9b184acd55fc56
@@ -44,11 +44,24 @@ module ActiveWindows
44
44
  @relation.window(to_window_hash)
45
45
  end
46
46
 
47
- # Delegate common relation/query methods so the chain is transparent
48
- delegate :to_sql, :to_a, :to_ary, :load, :loaded?, :each, :map, :first, :last, :count,
49
- :where, :select, :joins, :group, :having, :order, :limit, :offset, :reorder, :pluck,
50
- :find_each, :find_in_batches, :inspect, :exists?, :any?, :none?, :empty?,
51
- to: :to_relation
47
+ # Delegate to the materialized relation so the chain is transparent.
48
+ # Explicit delegates for Ruby protocol methods that must be defined eagerly.
49
+ delegate :to_sql, :to_a, :to_ary, :inspect, to: :to_relation
50
+
51
+ private
52
+
53
+ def method_missing(method, ...)
54
+ relation = to_relation
55
+ if relation.respond_to?(method)
56
+ relation.public_send(method, ...)
57
+ else
58
+ super
59
+ end
60
+ end
61
+
62
+ def respond_to_missing?(method, include_private = false)
63
+ to_relation.respond_to?(method, include_private) || super
64
+ end
52
65
  end
53
66
 
54
67
  module QueryMethods
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveWindows
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_windows
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Andriichuk