Define scope manually

Hi, could you consider to merge this code?
I think it is better if we can define scope methods by ourselves.