metova 0.0.15 → 0.0.16

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: b5f47a374f2f55939b012fc79df205ecad971693
4
- data.tar.gz: f7351d9e171fa20254afeb2613a113ed1e875f80
3
+ metadata.gz: d65921ece0867769dd44e292091b13e439901f09
4
+ data.tar.gz: d09f8ec5d946a38783a0cdd4e4648dd135f6fdc0
5
5
  SHA512:
6
- metadata.gz: f2b5815d32b62b9b86ae203b8ad513c364cbe7c05fcd8494406a6edf2cfcf54147dfc4e573cf7eb6ed4117bf619442d451587a878809cc3ef8f58f2bbaa1c093
7
- data.tar.gz: b8446aab3629c125f0b19fcb76cbc36ab6fce8ca808676799eca72aecdb44efe80bf54cba5671f1ff545acc02a92a79904f62e9ece4102db6d8d9b55d885efd8
6
+ metadata.gz: e465a29b2e268d7f0bd2535e4247646fc4ad8bd21801a688d440738692c5632827f96128498a59c9c4620e78b4bd82d3fc4b63d200797a27784594b800211665
7
+ data.tar.gz: aee087711884a9aa46f1fdbcaf7a3600a0e642182a6f73e01125423be628c61240ea030280174d1572ccdcffd64bff87db4ca86872aa5197f26e85d706ce1f2e
@@ -1,7 +1,6 @@
1
1
  module Metova
2
2
  module Responders
3
3
  module SortResponder
4
-
5
4
  def initialize(*)
6
5
  super
7
6
  @resource = sort(@resource) if response_should_be_sorted?
@@ -9,11 +8,11 @@ module Metova
9
8
 
10
9
  private
11
10
  def sort(resource)
12
- resource.order(field_to_order_by => direction)
11
+ resource.reorder field_to_order_by => direction
13
12
  end
14
13
 
15
14
  def response_should_be_sorted?
16
- controller.params.include?(:sort)
15
+ controller.params.include? :sort
17
16
  end
18
17
 
19
18
  def field_to_order_by
@@ -21,7 +20,7 @@ module Metova
21
20
  end
22
21
 
23
22
  def direction
24
- controller.params.fetch(:direction, :asc)
23
+ controller.params.fetch :direction, :asc
25
24
  end
26
25
  end
27
26
  end
@@ -1,3 +1,3 @@
1
1
  module Metova
2
- VERSION = '0.0.15'
2
+ VERSION = '0.0.16'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metova
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Logan Serman
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-01-09 00:00:00.000000000 Z
12
+ date: 2017-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails