app/models/flyboy/goal.rb in flyboy-1.0.7 vs app/models/flyboy/goal.rb in flyboy-1.1.0
- old
+ new
@@ -1,11 +1,10 @@
-require "dorsale/search"
-
module Flyboy
class Goal < ActiveRecord::Base
include AASM
include Dorsale::Search
+ include Dorsale::PolymorphicId
paginates_per 50
aasm(column: "status", whiny_transitions: false) do
state :open, initial: true
@@ -18,12 +17,12 @@
event :open do
transitions from: [:closed], to: :open
end
end
- has_many :tasks, dependent: :destroy
+ has_many :tasks, dependent: :destroy, as: :taskable
- validates :title, presence: true
+ validates :name, presence: true
validates :status, inclusion: {
in: proc { Flyboy::Goal.aasm.states.map(&:to_s) }
}
def initialize(*args)