paginative 0.0.11 → 0.0.12

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: cddedd919c12871404bc714b08dbfe1c0132f8de
4
- data.tar.gz: 30989c919ef281f875555229451a89910eb9b4b7
3
+ metadata.gz: 2a64d474b1aded8a37f02c41511f99ff4e8fc488
4
+ data.tar.gz: 1e73820c9e52bb4f1e5c060b4b04a5f15d7d01f5
5
5
  SHA512:
6
- metadata.gz: e237a0c2f5c73b760146a58da1151b4364b7ee6bc0f077a5cb8e4f4587d2c1d681cd95aa13ebdde7e77f96d0e7aadf0fcab0e12037eba0e611855fcc88827d63
7
- data.tar.gz: 62cc03a5ea20a24e5f77240dfc6c4179cbdc1502b9d9575399054e1e29edd1795a71a6a2729c19ec7a70bdc0bb1d86a8c74af71df31f9ce197c1cd2b484717d0
6
+ metadata.gz: 05ff2ccd932203e19ae8280d52834151a5911a992f606474bd739532106c8857764cff0d1573181107a2ead779cef44f22b7ce4231bf092c8fab9f1d055bb7b8
7
+ data.tar.gz: 9805812c35a95f2b962be5e51bfcc7e39782b37672c80cc07f95d85f67dc0c1262d1e104f53a605fc2b88701bd85341bf04157631b0899db99f1bcb9d6f5809c
@@ -5,7 +5,7 @@ module Paginative
5
5
  included do
6
6
  def self.by_distance_from(latitude, longitude, distance=0, limit=25)
7
7
  return [] unless latitude.present? && longitude.present?
8
- distance_sql = send(:distance_sql, latitude.to_f, longitude.to_f, {:units => :km, select_bearing: false, order: "distance ASC"})
8
+ distance_sql = send(:distance_sql, latitude.to_f, longitude.to_f, {:units => :km, select_bearing: false})
9
9
 
10
10
  self.where("#{distance_sql} > #{distance}").offset(0).limit(limit)
11
11
  end
@@ -24,7 +24,7 @@ module Paginative
24
24
 
25
25
  #replaces the / when tableizing a namespaced class
26
26
  field = field.sub('/','_')
27
-
27
+
28
28
  return self.order("#{field} DESC").where("#{field} < '#{value}'").limit(limit) if order == "desc"
29
29
  self.order("#{field} ASC").where("#{field} > '#{value}'").limit(limit)
30
30
  end
@@ -1,3 +1,3 @@
1
1
  module Paginative
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paginative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Norman