Permalink
Browse files

add years to speakers

  • Loading branch information...
1 parent e8dc4c0 commit d3054ccfc6afb8126d260dceca5df3e1764fa2de Justin McNally committed Mar 10, 2012
View
@@ -0,0 +1,4 @@
+class Speaker < ActiveRecord::Base
+ belongs_to :year
+ belongs_to :user
+end
@@ -0,0 +1,15 @@
+class CreateSpeakers < ActiveRecord::Migration
+ def change
+ create_table :speakers do |t|
+ t.integer :year_id
+ t.integer :user_id
+ t.timestamps
+ end
+ User.speaker.each do |spk|
+ newSpeaker = Speaker.new()
+ newSpeaker.user_id = spk.id
+ newSpeaker.year_id = 2011
+ newSpeaker.save
+ end
+ end
+end
@@ -0,0 +1,8 @@
+# Read about factories at http://github.com/thoughtbot/factory_girl
+
+FactoryGirl.define do
+ factory :speaker do
+ year_id 1
+ user_id 1
+ end
+end
@@ -0,0 +1,5 @@
+require 'spec_helper'
+
+describe Speaker do
+ pending "add some examples to (or delete) #{__FILE__}"
+end

0 comments on commit d3054cc

Please sign in to comment.