flounder 0.9.8 → 0.9.9

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: 0b671fc956d5fcd73817cdc07ec5e9dbd5b03751
4
- data.tar.gz: 1a6cf5f585030c036c5bd57abf4450d25103e529
3
+ metadata.gz: 940cc41b4684232c361a86fd4959dfef55b870b1
4
+ data.tar.gz: 1a06c9aad7acfb5a10a27338a63a384aaaa1b159
5
5
  SHA512:
6
- metadata.gz: 7803a9083fa04f1f3c0cef3ac9a781f699c55194676e4f362f610a38ff663f3893d07dc1de5da525eaafada13935bbc34c44f56e40218962096790c96e776d69
7
- data.tar.gz: 409cd4865b56744ae81129d6cc3eee861fb050c37bcda5943acad18885dca809e1d6c5fb779ce2bc220d33ebcd3171b1e8c84bf81367d92bbf6db827c82221f4
6
+ metadata.gz: b9172f01e03b4df6ae1e4ee05f88440a4adffd478d8908458790e6cfed7db595b42c3b2af62fae8d41456dbb2761a63f9238503f0d5e9ca56fa2b5d8c9b5de1e
7
+ data.tar.gz: 0df7ef74347458c652bf98a4f949153e25e97b8a8aed5e7372ac19d5527e32c6de5bf6e43feac782d3b74afc12384240612bd552b5eb14dff6cfb79dc0516d32
@@ -0,0 +1,33 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ flounder (0.9.8)
5
+ arel (~> 5, > 5.0.1)
6
+ connection_pool (~> 2)
7
+ hashie (~> 3, >= 3.2)
8
+ pg (~> 0.17)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ ae (1.8.2)
14
+ ansi
15
+ ansi (1.4.3)
16
+ arel (5.0.1.20140414130214)
17
+ brass (1.2.1)
18
+ connection_pool (2.0.0)
19
+ facets (2.9.3)
20
+ hashie (3.2.0)
21
+ pg (0.17.1)
22
+ qed (2.9.1)
23
+ ansi
24
+ brass
25
+ facets (>= 2.8)
26
+
27
+ PLATFORMS
28
+ ruby
29
+
30
+ DEPENDENCIES
31
+ ae
32
+ flounder!
33
+ qed
data/HISTORY CHANGED
@@ -11,4 +11,5 @@
11
11
  + nested transactions
12
12
  + subquery support
13
13
  + localized where as in where(entity, :field => value)
14
- + db.where(entity, hash) form, where all symbols are looked up in entity.
14
+ + db.where(entity, hash) form, where all symbols are looked up in entity.
15
+ + db.entity.join(:other_entity) is now allowed
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "flounder"
5
- s.version = '0.9.8'
5
+ s.version = '0.9.9'
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"
@@ -31,6 +31,8 @@ module Flounder::Query
31
31
  attr_reader :projection_prefixes
32
32
 
33
33
  def _join join_node, entity
34
+ entity = domain[entity] if entity.kind_of?(Symbol)
35
+
34
36
  @last_join = entity
35
37
 
36
38
  table = entity.table
@@ -82,6 +82,14 @@ Here are some non-crazy joins that also work.
82
82
  assert generates_sql(%Q(SELECT [fields] FROM "users" LEFT OUTER JOIN "posts" ON "users"."id" = "posts"."user_id"))
83
83
  ~~~
84
84
 
85
+ You might want to drop the calls to domain.
86
+
87
+ ~~~ruby
88
+ domain[:users].join(:posts).on(:id => :user_id).
89
+ assert generates_sql(
90
+ %Q(SELECT [fields] FROM "users" INNER JOIN "posts" ON "users"."id" = "posts"."user_id"))
91
+ ~~~
92
+
85
93
  Joining presents an interesting dilemma. There are two ways of joining things together, given three tables. The sequence A.B.C might mean to join A to B and C; it might also be interpreted to mean to join A to B and B to C. Here's how we solve this.
86
94
 
87
95
  ~~~ruby
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.8
4
+ version: 0.9.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaspar Schiess
@@ -88,6 +88,7 @@ extensions: []
88
88
  extra_rdoc_files: []
89
89
  files:
90
90
  - Gemfile
91
+ - Gemfile.lock
91
92
  - HACKING
92
93
  - HISTORY
93
94
  - LICENSE