kbam 0.4.4 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/kbam.rb +6 -3
  3. data/lib/kbam/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 755c164ac3b398cc35a4c4826bd9a9abc99dfc5d
4
- data.tar.gz: 4511a501b2e618e5407d9db8f64fa7652d6aeab5
3
+ metadata.gz: af73a5db8f0985e7be2bd8482f788d04147129fc
4
+ data.tar.gz: 3b13df4aac2290939b1ad4030735b09d36069af1
5
5
  SHA512:
6
- metadata.gz: 0902af02859811d38bb5c09f784dc111315f0079d990e1af2444e81e4f261a6eadc430b3a53fce7a5091533c45f2a88f4af9bba031b991ec1dc18fab7d41c377
7
- data.tar.gz: 9b38cb9c1472ac4f4d892f85ba5b86c3136fb1bfba20ba9724433489397934c6d0c7cb224f2bcc6b1e0e09f4ab676c888104632092c2f16114838a2bf7c9e6b7
6
+ metadata.gz: 9f1e68a1ce465b5ece0063aa379cba4c7e0724f042c8dc61cf78aa6e3a6500d7e75290c490aba337e50765ea0eaa50032a50b2737344012a98bcd6c7580913ae
7
+ data.tar.gz: d6cf93a5a6adbbadca00077820989f935f40f272e5d7f7ecbe4c269b73a8b35a1f385a0906d6abf02c8f851d109e7f4108491beeb1cc30f75de7c746b87ab48b
@@ -9,6 +9,8 @@ require 'kbam/extension.rb'
9
9
  class Kbam
10
10
  attr_reader :is_nested
11
11
  attr_writer :is_nested
12
+ attr_reader :no_count
13
+ attr_writer :no_count
12
14
 
13
15
  @@client = nil
14
16
  @@sugar = false
@@ -51,6 +53,7 @@ class Kbam
51
53
  @last_query = nil
52
54
  @result = nil
53
55
  @is_nested = false
56
+ @no_count = false
54
57
  @query_type = SELECT
55
58
  #@count_query = nil
56
59
 
@@ -634,10 +637,10 @@ class Kbam
634
637
  alias_method :length, :count
635
638
 
636
639
  def total
637
- if @result != nil
640
+ if @result != nil && ! @no_count
638
641
  @@client.query("SELECT FOUND_ROWS() AS count").first["count"]
639
642
  else
640
- warning "Can't count total for empty result"
643
+ warning "Can't count total for empty result. Or no count error."
641
644
  end
642
645
  end
643
646
 
@@ -711,7 +714,7 @@ class Kbam
711
714
 
712
715
  def compose_select
713
716
  select_string = "\nSELECT\n "
714
- unless is_nested
717
+ unless is_nested || @no_count
715
718
  select_string += "SQL_CALC_FOUND_ROWS "
716
719
  end
717
720
 
@@ -1,3 +1,3 @@
1
1
  class Kbam
2
- VERSION = "0.4.4"
2
+ VERSION = "0.4.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kbam
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leopold Burdyl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-19 00:00:00.000000000 Z
11
+ date: 2014-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mysql2