Currently I have an Order class. each order has 1 to infinite number of items. the number of items is not known until run time. since there is no field type of Array in active record / rails, how do you create a variable number of columns?
The only way I can think of is to specify a bunch of ticket columns ahead of time; but is very inflexible and inefficient:
class CreateOrders < ActiveRecord::Migration
def self.up
t.integer :ticket_id, :ticket_id, :ticket_id, :ticket_id, :ticket_id
t.decimal :total
t.timestamps
end
def self.down
drop_table :orders
end
end