Skip to content

Commit

Permalink
[api] extend check for supereseded_by settings to avoid to be set to …
Browse files Browse the repository at this point in the history
…zero
  • Loading branch information
adrianschroeter committed Jun 5, 2013
1 parent 8dc64c1 commit dc06450
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api/app/models/bs_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class SaveError < APIException
after_update :send_state_change

def check_supersede_state
if self.state == :superseded && self.superseded_by.nil?
if self.state == :superseded && ( not self.superseded_by.is_a? Numeric || not self.superseded_by > 0 )
errors.add(:superseded_by, 'Superseded_by should be set')
end
if self.superseded_by && self.state != :superseded
Expand Down

0 comments on commit dc06450

Please sign in to comment.