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.
@@ -1,7 +1,7 @@
1
1
  require 'activesupport'
2
2
 
3
3
  module PaginationScope
4
- VERSION = '0.1.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.count(:distinct => true, :select => "#{table_name}.#{primary_key}")
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
 
@@ -3,7 +3,7 @@ require 'rubygems'
3
3
  require 'activerecord'
4
4
  require 'active_record/fixtures'
5
5
 
6
- gem 'rspec', '~>1.1.11'
6
+ gem 'rspec'#, '~>1.1.11'
7
7
  require 'spec'
8
8
 
9
9
  SPEC_ROOT = Pathname(__FILE__).dirname.expand_path
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.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-03-21 00:00:00 +09:00
12
+ date: 2009-04-02 00:00:00 +09:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency