Growstuff/growstuff

View on GitHub
app/models/concerns/finishable.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

module Finishable
  extend ActiveSupport::Concern

  included do
    scope :finished, -> { where(finished: true) }
    scope :current, -> { where.not(finished: true) }

    def active
      !finished
    end
  end
end