ar_aggregate_by_interval 1.1.4 → 1.1.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d67fb1f746590e8801a28802ab2fd1aba5175f11
4
- data.tar.gz: c5618c06679af82e4d078ed02ddc150040cad40f
3
+ metadata.gz: 1c298fefa29a3f10b604344514cbdb4107f3ae14
4
+ data.tar.gz: 25ac0e6e1bc2aec6002ead9f3ed97d45cab933ab
5
5
  SHA512:
6
- metadata.gz: ccdd2612b245ebac746c3e5bb3756a8a021488de55325b5a378fe868ed08c5f1f1987bfd67612257c281d9d5f13cd8997de764fe9c1f00d9f3572037ab0945d0
7
- data.tar.gz: 9ccfddcab1829beec3c274ca62bea99f886ef6e9750a3a729d9353cd45e1ca30c588af7212e70fe3bd371ed82098c3b1154e2af7606743f1c1230eb5c73cd3f4
6
+ metadata.gz: 2e101fa39c200ca502387d95b63c3dae825e25273c57ab04bb5ca05a32b2cd3932f6e6fea0cbf21d3754aec4449e77cd09a9dfe245b16d803269cf12012485f0
7
+ data.tar.gz: d99af5d4a6cd05e067c933e66a2fd9fc88613b933d8511a4a44557e4a46b3a16579c82b44a63564c3db1b8286ba58ba3288531c83532915cbf80691e4ea7a0ad
data/CHANGELOG.md CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
3
3
  This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This file adheres to [Keep a changelog](http://keepachangelog.com/).
5
5
 
6
+ ## [1.1.5] - 2015-03-08 (maintenance)
7
+ ### Changed
8
+ - Raise ArgumentError instead of NoMethodError or RuntimeError on bad args
9
+
6
10
  ## [1.1.4] - 2015-03-08 (maintenance)
7
11
  ### Changed
8
12
  - Moved functionality from constructors to methods
@@ -29,7 +29,7 @@ module ArAggregateByInterval
29
29
  aggregate_column = nil
30
30
  end
31
31
  elsif sum_or_count != 'count' && aggregate_column.nil? || !(aggregate_column.is_a?(String) || aggregate_column.is_a?(Symbol))
32
- raise "aggregate_column cant be nil with #{sum_or_count}"
32
+ raise ArgumentError, "aggregate_column cant be nil with #{sum_or_count}"
33
33
  end
34
34
 
35
35
  return {
@@ -1,3 +1,3 @@
1
1
  module ArAggregateByInterval
2
- VERSION = '1.1.4'
2
+ VERSION = '1.1.5'
3
3
  end
@@ -23,7 +23,7 @@ module ArAggregateByInterval
23
23
  nil
24
24
  end
25
25
 
26
- return super unless hash_args
26
+ raise ArgumentError, 'incorrect ArAggregateByInterval arguments' unless hash_args
27
27
 
28
28
  # convert strings to symbols
29
29
  [:group_by_column, :aggregate_column].each do |col|
@@ -129,10 +129,10 @@ describe ArAggregateByInterval do
129
129
  subject do
130
130
  Blog.count_weekly(:created_at, {}, {})
131
131
  end
132
- it 'raise NoMethodError' do
132
+ it 'raise ArgumentError' do
133
133
  expect do
134
134
  subject
135
- end.to raise_error(NoMethodError)
135
+ end.to raise_error(ArgumentError)
136
136
  end
137
137
  end
138
138
 
@@ -140,10 +140,10 @@ describe ArAggregateByInterval do
140
140
  subject do
141
141
  Blog.sum_weekly(:created_at, @from, @from)
142
142
  end
143
- it 'raise NoMethodError' do
143
+ it 'raise ArgumentError' do
144
144
  expect do
145
145
  subject
146
- end.to raise_error(RuntimeError, /aggregate_column/)
146
+ end.to raise_error(ArgumentError, /aggregate_column/)
147
147
  end
148
148
  end
149
149
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_aggregate_by_interval
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Otto