Skip to content

Instantly share code, notes, and snippets.

@jackdempsey
Created November 10, 2008 21:54
Show Gist options
  • Select an option

  • Save jackdempsey/23651 to your computer and use it in GitHub Desktop.

Select an option

Save jackdempsey/23651 to your computer and use it in GitHub Desktop.
>> gist.errors
=> #<DataMapper::Validate::ValidationErrors:0x52ad104 @errors={:name=>["Name must not be blank"], :url=>["Url must not be blank"]}
>> gist.errors.keys
=> [:name, :url]
>> gist.errors[:name]
=> ["Name must not be blank"]
model:
validates_present :url
validates_present :name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment