خرید بک لینک

Vote count: 0

I have used this code in helper to display the count based on the status -

    def to_do_count
        Task.where(status: 0).count
    end 

    def in_progress_count
        Task.where(status: 1).count
    end

    def paused_count
        Task.where(status: 2).count
    end

    def completed_count
        Task.where(status: 3).count
    end

I need help to optimize this code as there are lot of repetitions.

asked 25 secs ago

برچسب: how to optimize code,how to optimize code in c,how to optimize code in java,how to optimize code in asp net,how to optimize code in php,how to optimize code in android,how to optimize code in sap abap,how to optimize code in matlab,how to optimize coded ui test,how to optimize code in ios, نویسنده: استخدام کار تاريخ: پنجشنبه 21 مرداد 1395 ساعت: 12:24

صفحه بندی