rom-sql 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -1
- data/lib/rom/sql/adapter.rb +5 -1
- data/lib/rom/sql/header.rb +2 -1
- data/lib/rom/sql/version.rb +1 -1
- data/spec/unit/relation_spec.rb +7 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b418fd66438b79201905f6028726de01065b463f
|
4
|
+
data.tar.gz: 07b4d5462ea91aea73913c11794d7946569c3d34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8525d555c7682a1122613f1b4de21205029f6a6c1d4f1046cdff8c875468cacca3846826f2007fa73fc98074733f3bcfe4027049c2cfb24aed585a6049ae20b0
|
7
|
+
data.tar.gz: 4efbe175a8462af7c47751ca171085e112f5d82da75f3dbc3d20d81e4eac568e558a93490af860dd800900f449d59d61ca12e7e1dd2da0560b3fbe94dac95f33
|
data/CHANGELOG.md
CHANGED
data/lib/rom/sql/adapter.rb
CHANGED
@@ -20,7 +20,7 @@ module ROM
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def schema
|
23
|
-
tables.map { |table| [table, dataset(table),
|
23
|
+
tables.map { |table| [table, dataset(table), columns(table)] }
|
24
24
|
end
|
25
25
|
|
26
26
|
def extend_relation_class(klass)
|
@@ -37,6 +37,10 @@ module ROM
|
|
37
37
|
connection.tables
|
38
38
|
end
|
39
39
|
|
40
|
+
def columns(table)
|
41
|
+
dataset(table).columns
|
42
|
+
end
|
43
|
+
|
40
44
|
def dataset(table)
|
41
45
|
connection[table]
|
42
46
|
end
|
data/lib/rom/sql/header.rb
CHANGED
data/lib/rom/sql/version.rb
CHANGED
data/spec/unit/relation_spec.rb
CHANGED
@@ -57,4 +57,11 @@ describe ROM::Relation do
|
|
57
57
|
expect(columns).to eql([:users__id___user_id])
|
58
58
|
end
|
59
59
|
end
|
60
|
+
|
61
|
+
describe '#inspect' do
|
62
|
+
it 'includes dataset and header' do
|
63
|
+
expect(users.inspect).to include('header')
|
64
|
+
expect(users.inspect).to include('dataset')
|
65
|
+
end
|
66
|
+
end
|
60
67
|
end
|