liquid_queries 0.0.3 → 0.0.4

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: 8998116a8c3f0cf0a5564913f01168bc1ad9947e
4
- data.tar.gz: df069ea6d7250cb802c5aafcd423a2423f369e2a
3
+ metadata.gz: 1ed2186c51888e888496a15618d15deba591da68
4
+ data.tar.gz: 8682b6aa196f2aac8f61a55a8a5b8fde7b3fe7cd
5
5
  SHA512:
6
- metadata.gz: 8874e5ac1c1c9e37bc6906d32d45b258f4aac596e22db64b8ca97c7111bfe4d5b45c614ee2f20edbaedf83eff23ad5208f88ecb2d5414d85b3e096e6fcd5de90
7
- data.tar.gz: 724bd9c219436d466da59f50d821985b8e96dc9af5bb23346057747cd6300a73b60ed1688a5b8dfc94cfa6933e75173a05b4aa506c0c369efb258ec9a03ff5ec
6
+ metadata.gz: 2a10a2d2c46bd727daf07a0c32a2fe1e4219070720ea827469aa1c6edba033ff3f27827985a17231ffd9f410931beaba664e90ad83388dc74e9968b706b49da3
7
+ data.tar.gz: 58eb1cd76fc49dc7be217af88877586b82f9d25fef225882bf68ac17f7bbe372e90d2b949abef6d6a466ccd5c2bacb6322ec49b4ca121c8b9ef7686639c56ede
@@ -19,12 +19,20 @@ module LiquidQueries::CollectionMethods
19
19
  collection.last
20
20
  end
21
21
 
22
+ def order
23
+ ::LiquidQueries::OrderQuery.new(collection: collection)
24
+ end
25
+
22
26
  def pop
23
27
  collection.pop
24
28
  end
25
29
 
26
30
  def ransack
27
- LiquidQueries::RansackQuery.new(collection: collection)
31
+ ::LiquidQueries::RansackQuery.new(collection: collection)
32
+ end
33
+
34
+ def reverse_order
35
+ ::LiquidQueries::Collection.new(collection: collection.reverse_order)
28
36
  end
29
37
 
30
38
  def shift
@@ -0,0 +1,11 @@
1
+ class LiquidQueries::OrderQuery < Liquid::Drop
2
+ def initialize(collection:)
3
+ @collection = collection
4
+ end
5
+
6
+ def before_method(key)
7
+ ::LiquidQueries::Collection.new(
8
+ collection: @collection.order(key)
9
+ )
10
+ end
11
+ end
@@ -4,7 +4,7 @@ class LiquidQueries::RansackQuery < Liquid::Drop
4
4
  end
5
5
 
6
6
  def before_method(key)
7
- LiquidQueries::RansackQueryValue.new(
7
+ ::LiquidQueries::RansackQueryValue.new(
8
8
  collection: @collection,
9
9
  key: key
10
10
  )
@@ -5,7 +5,7 @@ class LiquidQueries::RansackQueryValue < Liquid::Drop
5
5
  end
6
6
 
7
7
  def before_method(value)
8
- LiquidQueries::Collection.new(
8
+ ::LiquidQueries::Collection.new(
9
9
  collection: @collection.ransack(@key => value).result
10
10
  )
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module LiquidQueries
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
@@ -3,6 +3,7 @@ module LiquidQueries
3
3
 
4
4
  autoload :Collection, "#{path}/collection"
5
5
  autoload :CollectionMethods, "#{path}/collection_methods"
6
+ autoload :OrderQuery, "#{path}/order_query"
6
7
  autoload :RansackQuery, "#{path}/ransack_query"
7
8
  autoload :RansackQueryValue, "#{path}/ransack_query_value"
8
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid_queries
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaspernj
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-18 00:00:00.000000000 Z
11
+ date: 2017-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -54,6 +54,7 @@ files:
54
54
  - lib/liquid_queries/collection.rb
55
55
  - lib/liquid_queries/collection_methods.rb
56
56
  - lib/liquid_queries/engine.rb
57
+ - lib/liquid_queries/order_query.rb
57
58
  - lib/liquid_queries/ransack_query.rb
58
59
  - lib/liquid_queries/ransack_query_value.rb
59
60
  - lib/liquid_queries/version.rb