Skip to content

Commit

Permalink
validator class should run even without a target
Browse files Browse the repository at this point in the history
  • Loading branch information
goncalvesjoao committed Aug 1, 2016
1 parent 842a5a3 commit 68eb523
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
rest_my_case (2.0.2)
rest_my_case (2.0.3)
object_attorney (>= 3.0.6)

GEM
Expand All @@ -24,7 +24,7 @@ GEM
json (1.8.3)
method_source (0.8.2)
multi_json (1.12.1)
object_attorney (3.0.6)
object_attorney (3.0.7)
activemodel (>= 3.0.0)
parser (2.3.0.6)
ast (~> 2.2)
Expand Down
2 changes: 2 additions & 0 deletions lib/rest_my_case/validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ def self.target(name, options = {})
self.silence_dependencies_abort = true

def perform
return if defendant_options.empty?

error('unprocessable_entity') if invalid?
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rest_my_case/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RestMyCase
VERSION = '2.0.2'.freeze
VERSION = '2.0.3'.freeze
end

0 comments on commit 68eb523

Please sign in to comment.