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 +4 -4
- data/lib/paginative/models/model_extension.rb +2 -2
- data/lib/paginative/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a64d474b1aded8a37f02c41511f99ff4e8fc488
|
4
|
+
data.tar.gz: 1e73820c9e52bb4f1e5c060b4b04a5f15d7d01f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
data/lib/paginative/version.rb
CHANGED