-
Notifications
You must be signed in to change notification settings - Fork 0
Non-fatal rails 3 validations (ie, warnings rather than errors)
License
DanielHeath/warnr
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Warnr ====== Warnr builds on the power of Rails 3 validations. It lets you use validations to identify situations which are warnings rather than errors. It also lets you define a callback on the model which is executed after save if there are any warnings. Usage Example class Client < ActiveRecord::Base # Notify the client manager that the ABN has not been set belongs_to :manager, :class_name => "User" validates_presence_of :abn, :manager_id treat_validation_errors_as_warnings_on :abn on_save_with_warnings :handle_warnings def handle_warnings MissingDataNotifier.missing_data_notification(client.manager, client).deliver # Will save the record in a week, which will trigger this process again. DelayedJob.create(1.week, Client, client.id, :save) end end Copyright (c) 2010 Daniel Heath, released under the MIT license
About
Non-fatal rails 3 validations (ie, warnings rather than errors)
Resources
License
Stars
Watchers
Forks
Packages 0
No packages published