kasket 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,10 +23,13 @@ module Kasket
23
23
  def parse(sql)
24
24
  if match = @supported_query_pattern.match(sql)
25
25
  where, limit = match[1], match[2]
26
- if AR30 && where =~ /limit \d+\s*$/i
27
- # limit is harder to find in rails 3.0 since where does not use surrounding braces
28
- return unless where =~ /(.*?)(\s+limit 1)\s*$/i
29
- where, limit = $1, $2
26
+ if AR30
27
+ return if where =~ / (order by|group by|join|having) /i
28
+ if where =~ /limit \d+\s*$/i
29
+ # limit is harder to find in rails 3.0 since where does not use surrounding braces
30
+ return unless where =~ /(.*?)(\s+limit 1)\s*$/i
31
+ where, limit = $1, $2
32
+ end
30
33
  end
31
34
 
32
35
  query = Hash.new
@@ -3,7 +3,7 @@ module Kasket
3
3
  class Version
4
4
  MAJOR = 2
5
5
  MINOR = 2
6
- PATCH = 0
6
+ PATCH = 1
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  PROTOCOL = 3
9
9
  end
data/test/parser_test.rb CHANGED
@@ -34,6 +34,10 @@ class ParserTest < ActiveSupport::TestCase
34
34
  assert !parse(:conditions => "(0 = 1)")
35
35
  end
36
36
 
37
+ should "not support :order" do
38
+ assert !parse(:conditions => "id = 1", :order => "xxx")
39
+ end
40
+
37
41
  should 'not support IN queries in combination with other conditions' do
38
42
  assert !parse(:conditions => {:id => [1,2,3], :is_active => true})
39
43
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kasket
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-12-07 00:00:00.000000000 Z
13
+ date: 2012-12-11 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord
@@ -183,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
183
183
  version: '0'
184
184
  segments:
185
185
  - 0
186
- hash: 3681071488185082983
186
+ hash: -3400740618265195569
187
187
  required_rubygems_version: !ruby/object:Gem::Requirement
188
188
  none: false
189
189
  requirements:
@@ -192,7 +192,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
192
192
  version: '0'
193
193
  segments:
194
194
  - 0
195
- hash: 3681071488185082983
195
+ hash: -3400740618265195569
196
196
  requirements: []
197
197
  rubyforge_project:
198
198
  rubygems_version: 1.8.24