flounder 0.16.2 → 0.17.0

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
  SHA1:
3
- metadata.gz: b7af4331e93d451cfb0f0533c3cab1d5c2b25a5a
4
- data.tar.gz: b9e71279dab727864e0f8c1033fd65a77a5a57f3
3
+ metadata.gz: 787c40edcbbb187dfe3103cf3ac536b8f36da6ab
4
+ data.tar.gz: 7b4d0797c663cebaabe2a6535370129db329ef5d
5
5
  SHA512:
6
- metadata.gz: 18b9387c8b0d112b9c8f275c1013e55a28628bc3a2c5311318ddd4f30748fe117247b5efb3e08e35b21c4de1454c932f76c8cf92bfe32daad9134ddf3582b906
7
- data.tar.gz: 9d6d91ad2e82b677ff5c1f056ebb95e251634998be6beea1be1f1401829110c0d0c7739604a7897a7b004d3ce3c599e38221433abba5551e5fbf53d5068f4e04
6
+ metadata.gz: b9468c1b7af2c48c491f310103e78e201b7963f13422fdb1f83b6b8731b3f441e48a32931ee244eb3a68504d7789b178f84efaa1b75228944e6a7caba3628d21
7
+ data.tar.gz: 7d9e0fd8257ac9956b8e03791f6d6b7470c307c06609f265523f66e08720198b5b3f6170ec4038f56afced3c7a832c41b27dc3abab624804856f9ba233d876b5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- flounder (0.15.1)
4
+ flounder (0.16.0)
5
5
  aggregate (~> 0.2, >= 0.2.2)
6
6
  arel (~> 5, > 5.0.1)
7
7
  connection_pool (~> 2)
data/HISTORY CHANGED
@@ -1,3 +1,6 @@
1
+ # 0.17
2
+ + A call to order_by fully replaces previously set ordering.
3
+
1
4
  # 0.16
2
5
  + DRY joins using #connect - one declaration of relationships, many uses.
3
6
  + Timestamp with timezone
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "flounder"
5
- s.version = '0.16.2'
5
+ s.version = '0.17.0'
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"
@@ -115,9 +115,12 @@ module Flounder::Query
115
115
  parse_conditions(*conditions) { |bit| manager.having(bit) }
116
116
  end
117
117
 
118
- # Orders by a list of field references.
118
+ # Orders by a list of field references.
119
+ #
120
+ # Note: Replaces previous order_by.
119
121
  #
120
122
  def order_by *field_list
123
+ manager.orders.clear
121
124
  field_list.each do |field|
122
125
  field = transform field
123
126
  manager.order field
@@ -61,4 +61,17 @@ Ordering can be defined in many ways.
61
61
  titles_by(posts[:title]).assert == ['ABC', 'First Light']
62
62
  titles_by(posts[:title].asc).assert == ['ABC', 'First Light']
63
63
  titles_by(posts[:title].desc).assert == ['First Light', 'ABC']
64
+ ~~~
65
+
66
+ A call to order by replaces an earlier call.
67
+
68
+ ~~~ruby
69
+ query = domain[:posts].order_by(:title.asc)
70
+ sql = query.to_sql
71
+
72
+ sql.assert == 'SELECT "posts"."id" AS _posts_id, "posts"."title" AS _posts_title, "posts"."text" AS _posts_text, "posts"."user_id" AS _posts_user_id, "posts"."approver_id" AS _posts_approver_id FROM "posts" ORDER BY "posts"."title" ASC'
73
+
74
+ sql = query.order_by(:title.asc, :text.desc).to_sql
75
+
76
+ sql.assert == 'SELECT "posts"."id" AS _posts_id, "posts"."title" AS _posts_title, "posts"."text" AS _posts_text, "posts"."user_id" AS _posts_user_id, "posts"."approver_id" AS _posts_approver_id FROM "posts" ORDER BY "posts"."title" ASC, "posts"."text" DESC'
64
77
  ~~~
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.16.2
4
+ version: 0.17.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kaspar Schiess
@@ -9,114 +9,114 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-11-06 00:00:00.000000000 Z
12
+ date: 2014-11-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: arel
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - "~>"
19
19
  - !ruby/object:Gem::Version
20
20
  version: '5'
21
- - - '>'
21
+ - - ">"
22
22
  - !ruby/object:Gem::Version
23
23
  version: 5.0.1
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ~>
28
+ - - "~>"
29
29
  - !ruby/object:Gem::Version
30
30
  version: '5'
31
- - - '>'
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: 5.0.1
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: pg
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0.17'
41
41
  type: :runtime
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0.17'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: hashie
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3'
55
- - - '>='
55
+ - - ">="
56
56
  - !ruby/object:Gem::Version
57
57
  version: '3.2'
58
58
  type: :runtime
59
59
  prerelease: false
60
60
  version_requirements: !ruby/object:Gem::Requirement
61
61
  requirements:
62
- - - ~>
62
+ - - "~>"
63
63
  - !ruby/object:Gem::Version
64
64
  version: '3'
65
- - - '>='
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
67
  version: '3.2'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: connection_pool
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - ~>
72
+ - - "~>"
73
73
  - !ruby/object:Gem::Version
74
74
  version: '2'
75
75
  type: :runtime
76
76
  prerelease: false
77
77
  version_requirements: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - ~>
79
+ - - "~>"
80
80
  - !ruby/object:Gem::Version
81
81
  version: '2'
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: pg-hstore
84
84
  requirement: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - ~>
86
+ - - "~>"
87
87
  - !ruby/object:Gem::Version
88
88
  version: '1.2'
89
- - - '>='
89
+ - - ">="
90
90
  - !ruby/object:Gem::Version
91
91
  version: 1.2.0
92
92
  type: :runtime
93
93
  prerelease: false
94
94
  version_requirements: !ruby/object:Gem::Requirement
95
95
  requirements:
96
- - - ~>
96
+ - - "~>"
97
97
  - !ruby/object:Gem::Version
98
98
  version: '1.2'
99
- - - '>='
99
+ - - ">="
100
100
  - !ruby/object:Gem::Version
101
101
  version: 1.2.0
102
102
  - !ruby/object:Gem::Dependency
103
103
  name: aggregate
104
104
  requirement: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ~>
106
+ - - "~>"
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0.2'
109
- - - '>='
109
+ - - ">="
110
110
  - !ruby/object:Gem::Version
111
111
  version: 0.2.2
112
112
  type: :runtime
113
113
  prerelease: false
114
114
  version_requirements: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - ~>
116
+ - - "~>"
117
117
  - !ruby/object:Gem::Version
118
118
  version: '0.2'
119
- - - '>='
119
+ - - ">="
120
120
  - !ruby/object:Gem::Version
121
121
  version: 0.2.2
122
122
  description: " Flounder is the missing piece between the database and your Ruby
@@ -127,11 +127,14 @@ executables: []
127
127
  extensions: []
128
128
  extra_rdoc_files: []
129
129
  files:
130
- - flounder.gemspec
131
130
  - Gemfile
132
131
  - Gemfile.lock
133
132
  - HACKING
134
133
  - HISTORY
134
+ - LICENSE
135
+ - README
136
+ - flounder.gemspec
137
+ - lib/flounder.rb
135
138
  - lib/flounder/connection.rb
136
139
  - lib/flounder/connection_pool.rb
137
140
  - lib/flounder/domain.rb
@@ -152,8 +155,6 @@ files:
152
155
  - lib/flounder/query/update.rb
153
156
  - lib/flounder/relation.rb
154
157
  - lib/flounder/symbol_extensions.rb
155
- - lib/flounder.rb
156
- - LICENSE
157
158
  - qed/applique/ae.rb
158
159
  - qed/applique/flounder.rb
159
160
  - qed/applique/setup_domain.rb
@@ -172,7 +173,6 @@ files:
172
173
  - qed/projection.md
173
174
  - qed/selects.md
174
175
  - qed/updates.md
175
- - README
176
176
  homepage: https://bitbucket.org/technologyastronauts/oss_flounder
177
177
  licenses:
178
178
  - MIT
@@ -183,17 +183,17 @@ require_paths:
183
183
  - lib
184
184
  required_ruby_version: !ruby/object:Gem::Requirement
185
185
  requirements:
186
- - - '>='
186
+ - - ">="
187
187
  - !ruby/object:Gem::Version
188
188
  version: '0'
189
189
  required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  requirements:
191
- - - '>='
191
+ - - ">="
192
192
  - !ruby/object:Gem::Version
193
193
  version: '0'
194
194
  requirements: []
195
195
  rubyforge_project:
196
- rubygems_version: 2.0.14
196
+ rubygems_version: 2.2.2
197
197
  signing_key:
198
198
  specification_version: 4
199
199
  summary: Flounder is a way to write SQL simply in Ruby. It deals with everything BUT
@@ -217,3 +217,4 @@ test_files:
217
217
  - qed/projection.md
218
218
  - qed/selects.md
219
219
  - qed/updates.md
220
+ has_rdoc: