mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-10-31 03:09:06 -04:00
- Renamed all instances of 'Activity' to 'Job' in views, controllers, and models. - Updated routes to reflect the change from activities to jobs. - Modified database schema to rename the activities table to jobs and adjusted related columns. - Updated locale files to change activity-related translations to jobs. - Adjusted tests to ensure they reference jobs instead of activities. - Removed the category field from jobs as they are now a plain list. - Updated seed data and sample data generation to create jobs instead of activities.
20 lines
397 B
Ruby
20 lines
397 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Finishable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
scope :finished, -> { where(finished: true) }
|
|
scope :current, -> { where.not(finished: true) }
|
|
|
|
def active
|
|
# Plantings can fail. At the moment, jobs and seeds cannot.
|
|
if respond_to?(:failed)
|
|
!finished && !failed
|
|
else
|
|
!finished
|
|
end
|
|
end
|
|
end
|
|
end
|