quo 0.2.0 → 0.3.0

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: 6f8a79b64bd0db1439df6ffcfb820786ed082405bb24d56ac2ac08cb47c052b7
4
- data.tar.gz: 0b46427745aa9433130c4ec495cf2c9d79bff517b00ea99f17029b3a2714b604
3
+ metadata.gz: 3278d72f55569eb93fb569185467cd4b327ffd157e249c8538d4a643c652443c
4
+ data.tar.gz: e936c5fd0de429b941e110c273cb12ff302079095ab0f3d7d38023718b80b5e3
5
5
  SHA512:
6
- metadata.gz: 514f649e606616d7a46de0c409b4c3f635c11fe900f179e0f94952a594adb49877e82ced68e9541e2dd398e2b0e35e9ea8ff1c4995701ed8f30361de48f8ae78
7
- data.tar.gz: 7562f9cfc712ac473e6a32bb1c9f5b9e88123fb0abaa696f29dbf24e90dcedaaf716d42e0cd8bf6b8a5594a6f888fbf20f3e2b665ff9dda108ddc7ededfbe9a9
6
+ metadata.gz: 4adcb23af540cf2db462bd21640aef4497c1f2509a1ac6968a5a15b1cd2004d7db9935638ba5496eb57ffc655ad515688fc9468a191d17b32735da1a7c652705
7
+ data.tar.gz: f99119cdf52a97e956317a530e9074e12b07816405f6dd5fd80f74665dd34c0294368ed6d6a7d88f8147484486f52606462864663357e430ca2eebc36b7372d7
data/lib/quo/query.rb CHANGED
@@ -41,7 +41,7 @@ module Quo
41
41
 
42
42
  # Combine (compose) this query object with another composeable entity, see notes for `.compose` above.
43
43
  # Compose is aliased as `+`. Can optionally take `joins()` parameters to perform a joins before the merge
44
- def compose(right, joins = nil)
44
+ def compose(right, joins: nil)
45
45
  Quo::QueryComposer.new(self, right, joins).compose
46
46
  end
47
47
 
@@ -252,7 +252,6 @@ module Quo
252
252
  rel = rel.limit(@options[:limit]) if @options[:limit].present?
253
253
  rel = rel.preload(@options[:preload]) if @options[:preload].present?
254
254
  rel = rel.includes(@options[:includes]) if @options[:includes].present?
255
- rel = rel.joins(@options[:joins]) if @options[:joins].present?
256
255
  rel = rel.select(@options[:select]) if @options[:select].present?
257
256
  end
258
257
  rel
@@ -58,7 +58,7 @@ module Quo
58
58
  end
59
59
 
60
60
  def apply_joins(left_rel, joins)
61
- joins.present? ? left_rel.joins(joins.to_sym) : left_rel
61
+ joins.present? ? left_rel.joins(joins) : left_rel
62
62
  end
63
63
 
64
64
  def both_relations?(left_rel_type, right_rel_type)
@@ -6,7 +6,7 @@ module Quo
6
6
  # These can be Quo::Query, Quo::MergedQuery, Quo::EagerQuery and ActiveRecord::Relations.
7
7
  # See the `README.md` docs for more details.
8
8
  module Compose
9
- def compose(query1, query2, joins = nil)
9
+ def compose(query1, query2, joins: nil)
10
10
  Quo::QueryComposer.new(query1, query2, joins).compose
11
11
  end
12
12
 
data/lib/quo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Quo
4
- VERSION = "0.2.0"
4
+ VERSION = "0.3.0"
5
5
  end
data/sig/quo.rbs CHANGED
@@ -27,7 +27,7 @@ module Quo
27
27
  # Combine two query-like or composeable entities:
28
28
  # These can be Quo::Query, Quo::MergedQuery, Quo::EagerQuery and ActiveRecord::Relations.
29
29
  # See the `README.md` docs for more details.
30
- def compose: (composable query1, composable query2, ?untyped? joins) -> Quo::MergedQuery
30
+ def compose: (composable query1, composable query2, ?joins: untyped?) -> Quo::MergedQuery
31
31
 
32
32
  # Determines if the object `query` is something which can be composed with query objects
33
33
  def composable_with?: (merge_composable query) -> bool
@@ -90,7 +90,7 @@ module Quo
90
90
 
91
91
  def initialize: (**untyped options) -> void
92
92
  def query: () -> composable
93
- def compose: (composable right, ?untyped? joins) -> Quo::MergedQuery
93
+ def compose: (composable right, ?joins: untyped?) -> Quo::MergedQuery
94
94
  alias + compose
95
95
 
96
96
  def copy: (**untyped options) -> query
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen Ierodiaconou