flounder 0.9.11 → 0.9.12

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: eb355b42b818e47d6d615cb550779211635fe40c
4
- data.tar.gz: c7ecc8ba5b4b1bde6c8ac9213d0733f64fa169be
3
+ metadata.gz: 644cfad15bfccebed7cfb43c43ac22fde0151f8d
4
+ data.tar.gz: 38a5f5158fac174f9380e20380b22188b23dd33f
5
5
  SHA512:
6
- metadata.gz: 97d33b0970b670b8f53a6785c1b15ad060fe6756f93fc5d63cfbf55cf8e5c32005c3a37eef2a46d5cff82e787e61d0a1c8af825174791bc9f1382fff1f2873e0
7
- data.tar.gz: 1e9786ec35fbe6f53300f6f010051a265888d45bf3ed263d9ccf8d9be118253338f4fb787314e880d80f4f1b25f90ca965a38c2795c20f778e525c07f26f205d
6
+ metadata.gz: 7217b361145c7813b8d17c54c05e2396fca0a21644e2d61aa21514e97106cdb535dabd62259c24a395464cbda85c9f8d002d8dd4c0478b351a239b9d862d7d93
7
+ data.tar.gz: 1567204faa27723677978ee4acc63d25d3aae8b0ccdfa3491bb454adb4bfb6d90e6e19a74990037443eb738461c8927521e8190ffe9f84fa4c33503342d5d7b6
@@ -1,11 +1,11 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flounder (0.9.8)
4
+ flounder (0.4.0)
5
5
  arel (~> 5, > 5.0.1)
6
6
  connection_pool (~> 2)
7
7
  hashie (~> 3, >= 3.2)
8
- pg (~> 0.17)
8
+ pg (> 0.17)
9
9
 
10
10
  GEM
11
11
  remote: https://rubygems.org/
data/HISTORY CHANGED
@@ -13,4 +13,5 @@
13
13
  + localized where as in where(entity, :field => value)
14
14
  + db.where(entity, hash) form, where all symbols are looked up in entity.
15
15
  + db.entity.join(:other_entity) is now allowed
16
- + :symbol.in => ... is now working.
16
+ + :symbol.in => ... is now working.
17
+ + JOIN ... AND is now working.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "flounder"
5
- s.version = '0.9.11'
5
+ s.version = '0.9.12'
6
6
  s.summary = "Flounder is a way to write SQL simply in Ruby. It deals with everything BUT object relational mapping. "
7
7
  s.email = "kaspar.schiess@technologyastronauts.ch"
8
8
  s.homepage = "https://bitbucket.org/technologyastronauts/oss_flounder"
@@ -66,9 +66,8 @@ module Flounder::Query
66
66
  end
67
67
 
68
68
  def on join_conditions
69
- k, v = join_conditions.first
70
69
  manager.on(
71
- transform_tuple(entity, k, join_field(v)))
70
+ *join_conditions.map { |(k, v)| transform_tuple(entity, k, join_field(v)) })
72
71
  self
73
72
  end
74
73
  def anchor
@@ -0,0 +1,21 @@
1
+
2
+ Joins are correctly created.
3
+
4
+ ~~~ruby
5
+ query = domain[:posts].
6
+ join(users).on(:user_id => :id)
7
+
8
+ query.assert generates_sql(%Q(SELECT [fields] FROM "posts" INNER JOIN "users" ON "posts"."user_id" = "users"."id"))
9
+
10
+ row = query.first
11
+ row.post.id.assert == 1
12
+ ~~~
13
+
14
+ Joins are … joined using AND.
15
+
16
+ ~~~ruby
17
+ query = domain[:posts].
18
+ join(users).on(:user_id => :id, :strange_example_id => :id)
19
+
20
+ query.assert generates_sql(%Q(SELECT [fields] FROM "posts" INNER JOIN "users" ON "posts"."user_id" = "users"."id" AND "posts"."strange_example_id" = "users"."id"))
21
+ ~~~
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flounder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.11
4
+ version: 0.9.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaspar Schiess
@@ -123,6 +123,7 @@ files:
123
123
  - qed/flounder.sql
124
124
  - qed/index.md
125
125
  - qed/inserts.md
126
+ - qed/joins.md
126
127
  - qed/ordering.md
127
128
  - qed/projection.md
128
129
  - qed/results.md
@@ -148,7 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
148
149
  version: '0'
149
150
  requirements: []
150
151
  rubyforge_project:
151
- rubygems_version: 2.2.2
152
+ rubygems_version: 2.2.0
152
153
  signing_key:
153
154
  specification_version: 4
154
155
  summary: Flounder is a way to write SQL simply in Ruby. It deals with everything BUT
@@ -165,6 +166,7 @@ test_files:
165
166
  - qed/flounder.sql
166
167
  - qed/index.md
167
168
  - qed/inserts.md
169
+ - qed/joins.md
168
170
  - qed/ordering.md
169
171
  - qed/projection.md
170
172
  - qed/results.md