Module: Ticket::Foundry

Extended by:
ActiveSupport::Concern
Included in:
Chart, Section, Show
Defined in:
app/models/ticket/foundry.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#build_ticketsObject



26
27
28
# File 'app/models/ticket/foundry.rb', line 26

def build_tickets
  foundry_template.collect(&:build).flatten
end

#create_ticketsObject



22
23
24
# File 'app/models/ticket/foundry.rb', line 22

def create_tickets
  Ticket.import(build_tickets)
end

#foundry_templateObject



30
31
32
33
34
35
36
37
# File 'app/models/ticket/foundry.rb', line 30

def foundry_template
  if respond_to?(:foundry_using_next)
    template = next_template
    template.each { |template| template.update_attributes(foundry_attributes) }
  else
    Ticket::Template.new(foundry_attributes)
  end
end