Skip to content

Commit

Permalink
Added StroyVote model
Browse files Browse the repository at this point in the history
  • Loading branch information
cajun-code committed Dec 17, 2011
1 parent a07356b commit 71c0ffb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/room.rb
@@ -1,4 +1,4 @@
class Room < ActiveRecord::Base
has_and_belongs_to_many :users

has_many :story_votes
end
5 changes: 5 additions & 0 deletions app/models/story_vote.rb
@@ -0,0 +1,5 @@
class StoryVote < ActiveRecord::Base
belongs_to :user
belongs_to :room

end
1 change: 1 addition & 0 deletions app/models/user.rb
Expand Up @@ -9,4 +9,5 @@ class User < ActiveRecord::Base

has_many :pivotal_users
has_and_belongs_to_many :rooms
has_many :story_votes
end
12 changes: 12 additions & 0 deletions db/migrate/20111217170206_create_story_votes.rb
@@ -0,0 +1,12 @@
class CreateStoryVotes < ActiveRecord::Migration
def change
create_table :story_votes do |t|
t.integer :story_id
t.integer :user_id
t.integer :room_id
t.string :score

t.timestamps
end
end
end
5 changes: 5 additions & 0 deletions spec/models/story_vote_spec.rb
@@ -0,0 +1,5 @@
require 'spec_helper'

describe StoryVote do
pending "add some examples to (or delete) #{__FILE__}"
end

0 comments on commit 71c0ffb

Please sign in to comment.