Browse files

Merge pull request #64 from cktricky/patch-2

Update the use of `errors.add_to_base` with `self.errors.add :base`
  • Loading branch information...
2 parents e843ec2 + 53eb0da commit c8bc16e1ccd6e58de75f2fc1c39b0bbaa6297e9b @etdsoft etdsoft committed Jan 21, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/models/category.rb
View
4 app/models/category.rb
@@ -10,10 +10,10 @@ class Category < ActiveRecord::Base
private
def valid_destroy
if (self.id == 1)
- errors.add_to_base 'Cannot delete Default category.'
+ self.errors.add :base, 'Cannot delete Default category.'
end
if ( Note.count(:conditions =>{ :category_id => self.id }) > 0)
- errors.add_to_base 'Cannot delete Category with notes.'
+ self.errors.add :base, 'Cannot delete Category with notes.'
end
return errors.count.zero? ? true : false
end

0 comments on commit c8bc16e

Please sign in to comment.