Darling, I have a model Studentin which I indicated in it name_scope, for example. from_program, from_year, from_school, has_status, from_course, Etc.
Anyway, can I dynamically bind different named_scopedynamically depending on certain criteria at runtime?
for example, if the user accessing the data is "Finance", I want to be able to link only from_schooland has_status. if the user is a teacher, I want to be able to chain from_course, from_schooltogether and so on ...
Should i use named_scope? or should I just go back to the good old way of defining conditions?
Thanks for your suggestions in advance! =) btw I am using rails 2.3
source
share