22 lines
440 B
Ruby
22 lines
440 B
Ruby
module Milestoneable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
has_many :milestones, as: :milestoneable, dependent: :destroy
|
|
|
|
scope :with_milestones, -> { joins(:milestones).distinct }
|
|
|
|
has_many :progress_bars, as: :progressable
|
|
|
|
acts_as_taggable_on :milestone_tags
|
|
|
|
def primary_progress_bar
|
|
progress_bars.primary.first
|
|
end
|
|
|
|
def secondary_progress_bars
|
|
progress_bars.secondary
|
|
end
|
|
end
|
|
end
|