Created
February 12, 2012 18:39
-
-
Save mpattee/1810137 to your computer and use it in GitHub Desktop.
test validation in console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading development environment (Rails 2.3.11) | |
>> i = Item.find_by_id(50568) | |
=> #<Item id: 50568, character_id: 20370, created_at: "2012-02-12 18:13:16", updated_at: "2012-02-12 18:13:16", name: "New Item", url: "", quantity: 2, price: "", weight: "", itemDescription: ""> | |
>> i.quantity = nil | |
=> nil | |
>> i.save | |
=> false | |
>> i.errors | |
=> #<ActiveRecord::Errors:0x1035eea08 @base=#<Item id: 50568, character_id: 20370, created_at: "2012-02-12 18:13:16", updated_at: "2012-02-12 18:13:16", name: "New Item", url: "", quantity: nil, price: "", weight: "", itemDescription: "">, @errors=#<OrderedHash {"quantity"=>[#<ActiveRecord::Error:0x1035edd38 @type=:blank, @base=#<Item id: 50568, character_id: 20370, created_at: "2012-02-12 18:13:16", updated_at: "2012-02-12 18:13:16", name: "New Item", url: "", quantity: nil, price: "", weight: "", itemDescription: "">, @attribute=:quantity, @options={:default=>nil}, @message=:blank>]}>> | |
>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment