Sha256: 149e1ccd96db3f6d6b5a688cccfe7568c313cb12178ceea61b4b7de936718287

Contents?: true

Size: 1.02 KB

Versions: 69

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

69 entries across 69 versions & 1 rubygems

Version Path
wco_models-3.1.0.154 app/models/wco/office_action_template.rb
wco_models-3.1.0.153 app/models/wco/office_action_template.rb
wco_models-3.1.0.152 app/models/wco/office_action_template.rb
wco_models-3.1.0.151 app/models/wco/office_action_template.rb
wco_models-3.1.0.150 app/models/wco/office_action_template.rb
wco_models-3.1.0.149 app/models/wco/office_action_template.rb
wco_models-3.1.0.148 app/models/wco/office_action_template.rb
wco_models-3.1.0.147 app/models/wco/office_action_template.rb
wco_models-3.1.0.146 app/models/wco/office_action_template.rb
wco_models-3.1.0.145 app/models/wco/office_action_template.rb
wco_models-3.1.0.144 app/models/wco/office_action_template.rb
wco_models-3.1.0.143 app/models/wco/office_action_template.rb
wco_models-3.1.0.142 app/models/wco/office_action_template.rb
wco_models-3.1.0.141 app/models/wco/office_action_template.rb
wco_models-3.1.0.140 app/models/wco/office_action_template.rb
wco_models-3.1.0.139 app/models/wco/office_action_template.rb
wco_models-3.1.0.138 app/models/wco/office_action_template.rb
wco_models-3.1.0.137 app/models/wco/office_action_template.rb
wco_models-3.1.0.136 app/models/wco/office_action_template.rb
wco_models-3.1.0.135 app/models/wco/office_action_template.rb