#film.rb
def self.to_csv(options = {})
CSV.generate(options) do |csv|
csv << %w(Serial Formula Width Length Area Shelf SO Phase)
all.join_dimensions.each do |f|
csv << [f.serial, f.formula, f.width, f.length, f.area, f.shelf, f.sales_order_code, f.phase]
end
end
end
#film_movement.rb
def self.to_csv(options = {})
CSV.generate(options) do |csv|
csv << %w(Serial Formula Width Length Order User DateTime)
all.each do |m|
csv << [m.serial, m.formula, m.width, m.length, m.sales_order_code, m.created_at]
end
end
end
end
line_item.rb
def self.to_csv(options = {})
CSV.generate(options) do |csv|
csv << %w(SO# Type Custom-W Custom-L Pieces Wires Busbars Note)
all.each do |o|
csv << [o.sales_order_code, o.product_type, o.custom_width, o.custom_length, o.quantity, o.wire_length, o.busbar_type, o.note]
end
end
end
#master_films.rb
def self.to_csv(options = {})
types = defect_types
CSV.generate(options) do |csv|
csv << %w(Serial Formula Mix/g Machine ITO Thinky b* Chemist Operator Inspector EffW EffL) + types
all.each do |mf|
csv << [mf.serial, mf.formula, mf.mix_mass, mf.machine_code, mf.film_code_top, mf.thinky_code, mf.b_value, mf.chemist, mf.operator, mf.inspector, mf.effective_width, mf.effective_length, mf.yield] + types.map{ |type| mf.defect_count(type) }
end
end
end
#sales_order.rb
def self.to_csv(options = {})
CSV.generate(options) do |csv|
csv << %w(SO# Customer Released Due Ship-to Status Shipped Note)
all.each do |o|
csv << [o.code, o.customer, o.release_date, o.due_date, o.ship_to, o.status, o.ship_date, o.note]
end
end
end
Is there documentation for this fav_params?