sinatra_resource 0.4.6 → 0.4.7

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.6
1
+ 0.4.7
@@ -321,6 +321,8 @@ module SinatraResource
321
321
  { "errors" => object.errors.errors }
322
322
  when :invalid_params
323
323
  { "errors" => { "invalid_params" => object } }
324
+ when :invalid_filter
325
+ { "errors" => { "invalid_filter" => object } }
324
326
  when :no_params
325
327
  { "errors" => "no_params" }
326
328
  when :non_empty_params
@@ -370,8 +370,12 @@ module SinatraResource
370
370
  elsif search_string
371
371
  { :_keywords => search_string.downcase }
372
372
  elsif filter_string
373
- unsafe = QS_FILTER.parse(filter_string)
374
- sanitize(unsafe, model)
373
+ begin
374
+ unsafe = QS_FILTER.parse(filter_string)
375
+ sanitize(unsafe, model)
376
+ rescue QueryStringFilter::ParseError
377
+ error 400, convert(body_for(:invalid_filter, filter_string))
378
+ end
375
379
  else
376
380
  {}
377
381
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{sinatra_resource}
8
- s.version = "0.4.6"
8
+ s.version = "0.4.7"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["David James"]
12
- s.date = %q{2009-12-03}
12
+ s.date = %q{2009-12-15}
13
13
  s.description = %q{A DSL for creating RESTful actions with Sinatra and MongoMapper. It embraces the Resource Oriented Architecture as explained by Leonard Richardson and Sam Ruby.}
14
14
  s.email = %q{djames@sunlightfoundation.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sinatra_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David James
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-03 00:00:00 -05:00
12
+ date: 2009-12-15 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency