activetokyocabinet 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -62,7 +62,11 @@ module ActiveRecord
62
62
  private :tdbpath
63
63
 
64
64
  def count_rkey(tdb, parsed_sql)
65
- rkeys(tdb, parsed_sql).length
65
+ if (parsed_sql[:condition] || []).empty?
66
+ tdb.rnum
67
+ else
68
+ rkeys(tdb, parsed_sql).length
69
+ end
66
70
  end
67
71
  private :count_rkey
68
72
 
@@ -68,7 +68,11 @@ module ActiveRecord
68
68
  private :tdbopen
69
69
 
70
70
  def count_rkey(tdb, parsed_sql)
71
- query(tdb, parsed_sql).searchcount
71
+ if (parsed_sql[:condition] || []).empty?
72
+ tdb.rnum
73
+ else
74
+ query(tdb, parsed_sql).searchcount
75
+ end
72
76
  end
73
77
  private :count_rkey
74
78
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activetokyocabinet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - winebarrel