All pastes #838956 Raw Edit

Someone

public text v1 · immutable
#838956 ·published 2007-12-30 19:43 UTC
rendered paste body
class Foo < ActiveRecord::Base

   has_many :bars

end



class Bar < ActiveRecord::Base

   belongs_to :foos

end


###########################################
# rake migrate file

def self.up
   execute "alter table #{:bars} add constraint fk_fooID foreign key (#{:fooId}) references #{:foos}(id)"
end