restrack 1.6.0 → 1.6.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module RESTRack
12
12
 
13
13
  class ResourceController
14
14
  extend RESTRack::ResourceRelations
15
-
15
+
16
16
  attr_reader :action, :id, :params
17
17
  class << self; attr_accessor :key_type; end
18
18
 
@@ -39,7 +39,11 @@ module RESTRack
39
39
  unless self.respond_to?(@action.to_sym) or self.respond_to?(:method_missing)
40
40
  raise HTTP405MethodNotAllowed, 'Method not provided on controller.'
41
41
  end
42
- self.send(@action.to_sym, *args)
42
+ begin
43
+ self.send(@action.to_sym, *args)
44
+ rescue ArgumentError
45
+ raise HTTP400BadRequest, 'Method called with the incorrect number of arguments. This is most likely due to a call to an action that accepts identifier, which was not supplied in URL.'
46
+ end
43
47
  end
44
48
 
45
49
  # all internal methods are protected rather than private so that calling methods *could* be overriden if necessary.
@@ -1,3 +1,3 @@
1
1
  module RESTRack
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.0
4
+ version: 1.6.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-05 00:00:00.000000000 Z
12
+ date: 2012-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack