Skip to content

Commit

Permalink
we really don't need to validate an id
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed May 17, 2011
1 parent 3567451 commit 7a64f6d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
2 changes: 0 additions & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ class User < ActiveRecord::Base
validates_length_of :password, :within => 5..40, :allow_nil => true, :if => :validate_length_of_password?
validates_length_of :email, :maximum => 255, :allow_nil => true

validates_numericality_of :id, :only_integer => true, :allow_nil => true

attr_writer :confirm_password
class << self
def unprotected_attributes
Expand Down
7 changes: 0 additions & 7 deletions spec/models/user_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@
end
end

it 'should validate numericality' do
[:id].each do |field|
assert_valid field, '1', '0'
assert_invalid field, 'this must be a number', 'abcd', '1,2', '1.3'
end
end

it 'should validate confirmation' do
@user.confirm_password = true
assert_invalid :password, 'this must match confirmation', 'test'
Expand Down

0 comments on commit 7a64f6d

Please sign in to comment.