-
Notifications
You must be signed in to change notification settings - Fork 1
MishaConway/sequel_validation_exceptions
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Installation: 1) install the gem gem install sequel_validation_exceptions 2) specify the plugin in your sequel model plugin :validation_exceptions In a similar vein to the ActiveRecord ORM, this sequel plugin adds save!, update!, create!, and find_or_create! to the sequel model class. All of these methods will raise a Sequel::ValidationException if validation fails. Examples: >> blog = Blog.new :title => '' >> blog.save! Sequel::ValidationException: Could not save new Blog model due to failing validation: {:title=>["is not present"]} >> blog = Blog.first >> blog.update! :title => nil Sequel::ValidationException: Could not save Blog model due to failing validation: {:title=>["is not present"]} >> blog = Blog.create! Sequel::ValidationException: Could not save new Blog model due to failing validation: {:title=>["is not present"]} >> blog = Blog.find_or_create! :title => '' Sequel::ValidationException: Could not save new Blog model due to failing validation: {:title=>["is not present"]}
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published