yiffspace 0.1.5 → 0.1.6

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: 130a3c2464b516817b5edaccef159b8068125a6a708f2ae6439e9bbedad7551b
4
- data.tar.gz: ca6f878af263b8bb7da0af721c5199b90aae89354d23c288e0d0855776f7dcf4
3
+ metadata.gz: cefef031ead65141131e7f72f00e5566ff583af3f75aa206582c2995d6049ddb
4
+ data.tar.gz: 152bd5da392923c16cb846e7a0baea169ac376e2934d36ad2edbfc1f0ed74bcd
5
5
  SHA512:
6
- metadata.gz: 3e8ce51323d7ce79a288a5c2670b6257d1f00439f70dea6b1f65509dd60f6751585713e90cddc7712d55772515410467f3c0c74d8c71ad1cbbf2a7f53dd9e99c
7
- data.tar.gz: e51f8637f0b795ffd8da9b0aa0d02d569d4f36a2e07bafa3510ceba0fed96f04888c2a77e57506042e6d6e242593c5944c601732942752483215514eed238e6e
6
+ metadata.gz: 4936d1d24877c51abd5b9a7d3e2e9328732444ff662cca0b02ee77bf241be82522148ccc617b933186fbe40f0b1b0eaaf47cdfa75a57587b09ffcf3a6f763df7
7
+ data.tar.gz: 0f83b7762c858159b2ede8ec942210b7cca5a6b3b9a2d1da0cd4dff885df9007588b0e3c9a4641aa53b0c9af70d6178983fecf8d195b072b783ecff4b2408d5d
@@ -1,3 +1,8 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative("cross_join_lateral")
4
+ require_relative("cross_unnest")
5
+ require_relative("left_join_lateral")
6
+ require_relative("left_unnest")
7
+ require_relative("unnest")
3
8
  require_relative("where_chain")
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require("active_record/relation")
4
+ require_relative("../arel/cross_join_lateral")
5
+ require_relative("../../extensions/active_record/cross_join_lateral")
6
+
7
+ ActiveRecord::Relation.include(YiffSpace::Extensions::ActiveRecord::CrossJoinLateral)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require("active_record/relation")
4
+ require_relative("unnest")
5
+ require_relative("../../extensions/active_record/cross_unnest")
6
+
7
+ ActiveRecord::Relation.include(YiffSpace::Extensions::ActiveRecord::CrossUnnest)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require("active_record/relation")
4
+ require_relative("../arel/left_join_lateral")
5
+ require_relative("../../extensions/active_record/left_join_lateral")
6
+
7
+ ActiveRecord::Relation.include(YiffSpace::Extensions::ActiveRecord::LeftJoinLateral)
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require("active_record/relation")
4
+ require_relative("unnest")
5
+ require_relative("../../extensions/active_record/left_unnest")
6
+
7
+ ActiveRecord::Relation.include(YiffSpace::Extensions::ActiveRecord::LeftUnnest)
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require("active_record/relation")
4
+ require_relative("cross_join_lateral")
5
+ require_relative("left_join_lateral")
6
+ require_relative("../../extensions/active_record/unnest")
7
+
8
+ ActiveRecord::Relation.include(YiffSpace::Extensions::ActiveRecord::Unnest)
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YiffSpace
4
+ module Extensions
5
+ module ActiveRecord
6
+ module CrossJoinLateral
7
+ def cross_join_lateral(relation)
8
+ raise(ArgumentError, "The method .cross_join_lateral() must contain arguments.") if relation.nil?
9
+
10
+ relation = relation.arel if relation.respond_to?(:arel)
11
+ spawn.cross_join_lateral!(relation)
12
+ end
13
+
14
+ def cross_join_lateral!(relation) # :nodoc:
15
+ manager = klass.arel_table.cross_join_lateral(relation)
16
+
17
+ self.joins_values |= [manager.join_sources.first]
18
+ self
19
+ end
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YiffSpace
4
+ module Extensions
5
+ module ActiveRecord
6
+ module CrossUnnest
7
+ def cross_unnest(column, as: column.singularize)
8
+ raise(ArgumentError, "The method .cross_unnest() must contain arguments.") if column.nil?
9
+
10
+ spawn.unnest(column, as: as, type: :cross_join_lateral)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YiffSpace
4
+ module Extensions
5
+ module ActiveRecord
6
+ module LeftJoinLateral
7
+ def left_join_lateral(relation, on: nil)
8
+ raise(ArgumentError, "The method .left_join_lateral() must contain arguments.") if relation.nil?
9
+
10
+ relation = relation.arel if relation.respond_to?(:arel)
11
+ spawn.left_join_lateral!(relation, on: on)
12
+ end
13
+
14
+ def left_join_lateral!(relation, on: nil) # :nodoc:
15
+ manager = klass.arel_table.left_join_lateral(relation)
16
+ manager.on(on) if on
17
+
18
+ self.joins_values |= [manager.join_sources.first]
19
+ self
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YiffSpace
4
+ module Extensions
5
+ module ActiveRecord
6
+ module LeftUnnest
7
+ def left_unnest(column, as: column.singularize)
8
+ raise(ArgumentError, "The method .left_unnest() must contain arguments.") if column.nil?
9
+
10
+ spawn.unnest(column, as: as, type: :left_join_lateral)
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module YiffSpace
4
+ module Extensions
5
+ module ActiveRecord
6
+ module Unnest
7
+ def unnest(column, as: column.singularize, type: :left_join_lateral)
8
+ raise(ArgumentError, "The method .unnest() must contain arguments.") if column.nil?
9
+
10
+ spawn.unnest!(column, as, type)
11
+ end
12
+
13
+ def unnest!(column, name, type) # :nodoc:
14
+ function = ::Arel::Nodes::NamedFunction.new("unnest", [klass.arel_table[column]]).as(name)
15
+ spawn.send("#{type}!", function, **({ on: ::Arel.sql("TRUE") } if type == :left_join_lateral))
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YiffSpace
4
- VERSION = "0.1.5"
4
+ VERSION = "0.1.6"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yiffspace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Donovan_DMC
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-08-19 00:00:00.000000000 Z
10
+ date: 2026-08-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: abbrev
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - ">="
45
45
  - !ruby/object:Gem::Version
46
- version: '7.1'
46
+ version: '8.1'
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - ">="
52
52
  - !ruby/object:Gem::Version
53
- version: '7.1'
53
+ version: '8.1'
54
54
  - !ruby/object:Gem::Dependency
55
55
  name: request_store
56
56
  requirement: !ruby/object:Gem::Requirement
@@ -114,6 +114,11 @@ files:
114
114
  - lib/yiffspace/configuration.rb
115
115
  - lib/yiffspace/configuration/images.rb
116
116
  - lib/yiffspace/core_ext/active_record/all.rb
117
+ - lib/yiffspace/core_ext/active_record/cross_join_lateral.rb
118
+ - lib/yiffspace/core_ext/active_record/cross_unnest.rb
119
+ - lib/yiffspace/core_ext/active_record/left_join_lateral.rb
120
+ - lib/yiffspace/core_ext/active_record/left_unnest.rb
121
+ - lib/yiffspace/core_ext/active_record/unnest.rb
117
122
  - lib/yiffspace/core_ext/active_record/where_chain.rb
118
123
  - lib/yiffspace/core_ext/all.rb
119
124
  - lib/yiffspace/core_ext/arel/all.rb
@@ -129,6 +134,11 @@ files:
129
134
  - lib/yiffspace/core_ext/string/all.rb
130
135
  - lib/yiffspace/core_ext/string/sql.rb
131
136
  - lib/yiffspace/engine.rb
137
+ - lib/yiffspace/extensions/active_record/cross_join_lateral.rb
138
+ - lib/yiffspace/extensions/active_record/cross_unnest.rb
139
+ - lib/yiffspace/extensions/active_record/left_join_lateral.rb
140
+ - lib/yiffspace/extensions/active_record/left_unnest.rb
141
+ - lib/yiffspace/extensions/active_record/unnest.rb
132
142
  - lib/yiffspace/extensions/active_record/where_chain.rb
133
143
  - lib/yiffspace/extensions/arel/nodes/cross_join_lateral.rb
134
144
  - lib/yiffspace/extensions/arel/nodes/left_join_lateral.rb