This project is archived and is in readonly mode.
Allow multiple conditions for callbacks
Reported by L. Caviola | December 24th, 2008 @ 01:37 PM
This patch makes it possible to use :if and :unless together when using callbacks and allows you to add multiple conditions as an array.
Example:
before_validation :set_random_user, :unless => :user, :if => :beginning
validate :validates_user, :if => [:user, :beginning]
Comments and changes to this ticket
-
L. Caviola December 24th, 2008 @ 02:44 PM
- Tag changed from activesupport, callback, improvement to activesupport, callback, improvement, patch, tested
A nicer way to do this (thanks to fcheung)
-
Pratik December 28th, 2008 @ 04:09 PM
- Assigned user set to josh
-
josh December 28th, 2008 @ 08:58 PM
- Milestone cleared.
- State changed from new to open
-
Repository December 28th, 2008 @ 09:14 PM
- State changed from open to resolved
(from [1e45818a622405e720a4529795f8be2f11660361]) Allow multiple conditions for callbacks [#1627 state:resolved] http://github.com/rails/rails/co...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1627 Allow multiple conditions for callbacks (from [1e45818a622405e720a4529795f8be2f11660361]) Allow m...