Sha256: 141ce7b8a61e421b3f7d63cfa0e97df0526153d5cfe2de8cc3d5ecc424832e96

Contents?: true

Size: 1.02 KB

Versions: 46

Compression:

Stored size: 1.02 KB

Contents

require 'wco/ai_writer'

##
## A Publisher is an OAT
##
class Wco::OfficeActionTemplate
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  store_in collection: 'wco_office_action_templates'

  field :slug
  validates :slug, presence: true, uniqueness: true

  belongs_to :from,      polymorphic: true,            optional: true
  belongs_to :publisher, class_name: 'Wco::Publisher', optional: true

  field :action_exe, type: :string
  validates :action_exe, presence: true
  def do_run
    eval( action_exe )
  end

  has_many :office_actions, inverse_of: :office_action_template
  def actions; office_actions; end

  has_many :ties,      class_name: 'OfficeActionTemplateTie', inverse_of: :office_action_template
  has_many :prev_ties, class_name: 'OfficeActionTemplateTie', inverse_of: :next_office_action_template
  accepts_nested_attributes_for :ties

  def to_s
    "#{slug}"
  end

  def self.list
    [[nil,nil]] + all.map { |ttt| [ ttt.slug, ttt.id ] }
  end

end
OAT = Wco::OfficeActionTemplate

Version data entries

46 entries across 46 versions & 1 rubygems

Version Path
wco_models-3.1.0.85 app/models/wco/office_action_template.rb
wco_models-3.1.0.83 app/models/wco/office_action_template.rb
wco_models-3.1.0.82 app/models/wco/office_action_template.rb
wco_models-3.1.0.81 app/models/wco/office_action_template.rb
wco_models-3.1.0.80 app/models/wco/office_action_template.rb
wco_models-3.1.0.79 app/models/wco/office_action_template.rb
wco_models-3.1.0.78 app/models/wco/office_action_template.rb
wco_models-3.1.0.77 app/models/wco/office_action_template.rb
wco_models-3.1.0.76 app/models/wco/office_action_template.rb
wco_models-3.1.0.75 app/models/wco/office_action_template.rb
wco_models-3.1.0.74 app/models/wco/office_action_template.rb
wco_models-3.1.0.73 app/models/wco/office_action_template.rb
wco_models-3.1.0.72 app/models/wco/office_action_template.rb
wco_models-3.1.0.71 app/models/wco/office_action_template.rb
wco_models-3.1.0.70 app/models/wco/office_action_template.rb
wco_models-3.1.0.69 app/models/wco/office_action_template.rb
wco_models-3.1.0.67 app/models/wco/office_action_template.rb
wco_models-3.1.0.66 app/models/wco/office_action_template.rb
wco_models-3.1.0.65 app/models/wco/office_action_template.rb
wco_models-3.1.0.64 app/models/wco/office_action_template.rb