How can I add a custom condition for after_filter or before_filter
How can I have something like this:
after_filter :handle_student_time_tracking, :condition=> ( !current_student.nil? )
I can put the condition inside handle_student_time_tracking but, I think there is a better way
Please advice
You should put the conditions in your filter, not on the after_filter call. Like this:
The conditions that filters provide are for actions, like
onlyandexcept, not based on other conditions.Reference: