mysql_framework 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 30e4dba5e1c3a4c988b3c1384bd9ef59b3a0efc0e562aa180aa8ee2bbcd31fff
4
- data.tar.gz: c8a387e05c36ad6b900bcf3dc268c28222fee086c9eef9a56aab770cd4a04e25
3
+ metadata.gz: a74ebb1d0b4fb35020acec587f1eeacffa3304b5c1dc5fc79d3029c67a729e49
4
+ data.tar.gz: 2d0bc5074297085431f4def95bd8273c200eef9ecf3b4ddf26d7b936640b2978
5
5
  SHA512:
6
- metadata.gz: daf10b0a2e39f8b8837f90c87a6585ba8bb786499e9ab64718e8b93370098fc3a5878b8196c586ed5b8231c3a8f2ae5cea259b9c66495ed01c03b35a872e432c
7
- data.tar.gz: a4dee54ea3cd66f3b08a12865cdd3e78b053973555cacd1ebaf576d624371197b5de4683bb2e0eb07d7d99e5774fc4b4255da296eb28513a41c7c8bacb24b293
6
+ metadata.gz: b954371d4415354b0c48624109c38107d8d132f3ecf104a94afa8503f04bedae5f89e034d87dd2d8632a31a7208f6a8a551ee59fb7fecc5035b17d09c39de21d
7
+ data.tar.gz: dca66fff5384d6e9fb324fc271fdc9c546d0f2bf68a7347314f1a22e68cda22505c4cd4758b2775bd2aaf1c6b054daebb74929ba9b71b05b3c0a6651d76e0c52
@@ -127,5 +127,11 @@ module MysqlFramework
127
127
  @sql += " on #{column_1} = #{column_2}"
128
128
  self
129
129
  end
130
+
131
+ # This method is called to add a `group by` statement to a query
132
+ def group_by(*columns)
133
+ @sql += " group by #{columns.join(',')}"
134
+ self
135
+ end
130
136
  end
131
137
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MysqlFramework
4
- VERSION = '0.0.3'
4
+ VERSION = '0.0.4'
5
5
  end
@@ -220,4 +220,11 @@ describe MysqlFramework::SqlQuery do
220
220
  expect(subject.sql).to eq('on `gems`.`id` = `versions`.`gem_id`')
221
221
  end
222
222
  end
223
+
224
+ describe '#group_by' do
225
+ it 'appends the sql for a group by statement' do
226
+ subject.group_by(gems[:created_at], gems[:updated_at])
227
+ expect(subject.sql).to eq('group by `gems`.`created_at`,`gems`.`updated_at`')
228
+ end
229
+ end
223
230
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mysql_framework
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler