pagination_scope 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/pagination_scope.rb +6 -2
- data/spec/spec_helper.rb +1 -1
- metadata +2 -2
data/lib/pagination_scope.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'activesupport'
|
2
2
|
|
3
3
|
module PaginationScope
|
4
|
-
VERSION = '0.1.
|
4
|
+
VERSION = '0.1.2'
|
5
5
|
|
6
6
|
class << self
|
7
7
|
def included(base)
|
@@ -34,7 +34,11 @@ module PaginationScope
|
|
34
34
|
|
35
35
|
def count
|
36
36
|
@count ||= with_scope :find => proxy_options.except(:offset, :limit) do
|
37
|
-
proxy_scope.
|
37
|
+
if proxy_scope.respond_to?(:proxy_options)
|
38
|
+
select = proxy_scope.proxy_options[:group]
|
39
|
+
end
|
40
|
+
select ||= "#{table_name}.#{primary_key}"
|
41
|
+
proxy_scope.count(:distinct => true, :select => select)
|
38
42
|
end
|
39
43
|
end
|
40
44
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagination_scope
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Genki Takiuchi
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-04-02 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|