This project is archived and is in readonly mode.
no callbacks should be created for empty only option
Reported by Subba | August 3rd, 2010 @ 10:12 PM | in 3.x
Callback module creates all callbacks if empty array is provided
for only option.
example.
define_model_callbacks :empty, :only => []
creates all three after, before,around filters.
this patch fixes this issue.
Comments and changes to this ticket
-
Subba August 4th, 2010 @ 07:39 PM
- Assigned user changed from Santiago Pastorino to José Valim
-
José Valim August 4th, 2010 @ 07:44 PM
- Importance changed from to Low
Why would you pass :only => []?
-
Subba August 4th, 2010 @ 08:09 PM
what if some meta programming construct creates empty array. you don't want it to create callbacks.
-
José Valim August 4th, 2010 @ 08:16 PM
- State changed from new to invalid
If this is the case, I would prefer to raise an error. It makes no sense such construct and I can't see a reason to be worried about such special case.
-
Subba August 4th, 2010 @ 08:20 PM
do you want me to change the patch to raise an error. or leave the code in current form.
-
José Valim August 4th, 2010 @ 08:25 PM
- State changed from invalid to new
- Milestone set to 3.x
Sorry, I marked it as invalid by mistake. I will actually apply the current patch since raising an error would just add even more lines of code. :) Thanks!
-
Repository August 14th, 2010 @ 12:23 PM
- State changed from new to resolved
(from [f8f437191f1cbf37ba842038164c1b873dc453e9]) no callbacks should be created for empty array [#5289 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/f8f437191f1cbf37ba842038164c1b...
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
- 5289 no callbacks should be created for empty only option (from [f8f437191f1cbf37ba842038164c1b873dc453e9]) no call...