graphql-rails-api 0.9.3.pre.fix → 0.9.3

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: 28fb07b00c4ddc6fab6260937a8ab6b5edd025ae6703ab2334a3fba30e56619c
4
- data.tar.gz: 5991b8d3475a620d0c4a0a6106795b8559123cfc65faf6f9cb3a5f44292778ec
3
+ metadata.gz: dfe867c4f64d230748b3d8a9d1aece95a16c6692d96491fd67298ad522ddd5ce
4
+ data.tar.gz: 0a407e15eff08e02e8a202da0d47d3fe6116af42eb591421e3b5a914964f7a48
5
5
  SHA512:
6
- metadata.gz: 95f60329781d38bf3275a24617868a2baa0fa82812fb4ecd5b79c36f45bbc9ad69a8f98270c797d76df384719417a60fb27a6cd31350c5fb1baa1ceecaae9ceb
7
- data.tar.gz: 9c76d727e713a14110ea7e77314f446d5c996719abacd228f05202c8c1b7f379e9c1bdb2e67bdc6173bcfc2a6a84a704de6e32d60dd4155f68f769619aaeb822
6
+ metadata.gz: e508676774b519da77b95483e1a0d28a91e1843925dc1669f674cb958d911ada161968923a385d86af51b86d47af56baecff3fe5a959cb1b727aed556834df6c
7
+ data.tar.gz: 3e1aefb503057898ba28eb3008fd2e8b4c63f792fd530ac0a3bcfdf8754ed168a5b5f7f6c1dbaf76f96961494bd03da7f905fc57ba19ccaabd26af1eb8dddffc
@@ -57,28 +57,25 @@ module Graphql
57
57
  def transform_order
58
58
  return if @order_by.blank?
59
59
 
60
- @order_by.split(",").each do |order|
61
-
62
- sign = order.split(" ").last.downcase == "desc" ? "desc" : "asc"
63
- column = order.split(" ").first.strip
64
-
65
- if column.include?(".")
66
- associated_model = column.split(".").first
67
- accessor = column.split(".").last
68
- assoc = get_assoc!(@model, associated_model)
69
- field_type = get_field_type!(assoc.klass, accessor)
70
- @model = @model.left_joins(associated_model.to_sym)
71
- ordered_field = "#{associated_model.pluralize}.#{accessor}"
72
- else
73
- field_type = get_field_type!(@model, column)
74
- ordered_field = "#{model_name.pluralize}.#{column}"
75
- end
60
+ sign = @order_by.split(" ").last.downcase == "desc" ? "desc" : "asc"
61
+ column = @order_by.split(" ").first.strip
62
+
63
+ if column.include?(".")
64
+ associated_model = column.split(".").first
65
+ accessor = column.split(".").last
66
+ assoc = get_assoc!(@model, associated_model)
67
+ field_type = get_field_type!(assoc.klass, accessor)
68
+ @model = @model.left_joins(associated_model.to_sym)
69
+ ordered_field = "#{associated_model.pluralize}.#{accessor}"
70
+ else
71
+ field_type = get_field_type!(@model, column)
72
+ ordered_field = "#{model_name.pluralize}.#{column}"
73
+ end
76
74
 
77
- @model = if %i[string text].include?(field_type)
78
- @model.order(Arel.sql("upper(#{ordered_field}) #{sign}"))
79
- else
80
- @model.order(Arel.sql("#{ordered_field} #{sign}"))
81
- end
75
+ @model = if %i[string text].include?(field_type)
76
+ @model.order(Arel.sql("upper(#{ordered_field}) #{sign}"))
77
+ else
78
+ @model.order(Arel.sql("#{ordered_field} #{sign}"))
82
79
  end
83
80
  end
84
81
 
@@ -1,7 +1,7 @@
1
1
  module Graphql
2
2
  module Rails
3
3
  module Api
4
- VERSION = "0.9.3-fix".freeze
4
+ VERSION = "0.9.3".freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-rails-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3.pre.fix
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - poilon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-14 00:00:00.000000000 Z
11
+ date: 2022-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -110,11 +110,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
110
110
  version: '0'
111
111
  required_rubygems_version: !ruby/object:Gem::Requirement
112
112
  requirements:
113
- - - ">"
113
+ - - ">="
114
114
  - !ruby/object:Gem::Version
115
- version: 1.3.1
115
+ version: '0'
116
116
  requirements: []
117
- rubygems_version: 3.1.2
117
+ rubygems_version: 3.3.7
118
118
  signing_key:
119
119
  specification_version: 4
120
120
  summary: Graphql rails api framework to create easily graphql api with rails