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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a74ebb1d0b4fb35020acec587f1eeacffa3304b5c1dc5fc79d3029c67a729e49
|
4
|
+
data.tar.gz: 2d0bc5074297085431f4def95bd8273c200eef9ecf3b4ddf26d7b936640b2978
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
@@ -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.
|
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-
|
11
|
+
date: 2018-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|