diff --git a/app/models/poll_answers.rb b/app/models/poll_answers.rb index b400ddf50..8a8c3169a 100644 --- a/app/models/poll_answers.rb +++ b/app/models/poll_answers.rb @@ -1,3 +1,5 @@ class PollAnswers < ActiveRecord::Base attr_accessible :answer_position, :answer_text, :poll_questions_id + + belongs_to :poll_questions end diff --git a/app/models/poll_questions.rb b/app/models/poll_questions.rb index 42e376aee..ce272a218 100644 --- a/app/models/poll_questions.rb +++ b/app/models/poll_questions.rb @@ -1,3 +1,5 @@ class PollQuestions < ActiveRecord::Base attr_accessible :is_necessary, :polls_id, :question_title, :question_type + + belongs_to :polls end diff --git a/app/models/poll_user.rb b/app/models/poll_user.rb index f77f2ed5c..a03f6b17d 100644 --- a/app/models/poll_user.rb +++ b/app/models/poll_user.rb @@ -1,3 +1,6 @@ class PollUser < ActiveRecord::Base attr_accessible :poll_id, :user_id + + belongs_to :polls + belongs_to :user end diff --git a/app/models/poll_votes.rb b/app/models/poll_votes.rb index 961f0d896..fe52b4ac5 100644 --- a/app/models/poll_votes.rb +++ b/app/models/poll_votes.rb @@ -1,3 +1,7 @@ class PollVotes < ActiveRecord::Base attr_accessible :poll_answers_id, :poll_questions_id, :user_id, :vote_text + + belongs_to :poll_answers + belongs_to :poll_questions + belongs_to :user end diff --git a/app/models/polls.rb b/app/models/polls.rb index f37c89fe2..02de95dce 100644 --- a/app/models/polls.rb +++ b/app/models/polls.rb @@ -1,3 +1,5 @@ class Polls < ActiveRecord::Base attr_accessible :closed_at, :polls_group_id, :polls_name, :polls_status, :polls_type, :published_at, :user_id + + belongs_to :user end diff --git a/db/schema.rb b/db/schema.rb index 04a2e54c8..e919d4118 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20141231085350) do +ActiveRecord::Schema.define(:version => 20150108035338) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -790,6 +790,51 @@ ActiveRecord::Schema.define(:version => 20141231085350) do t.integer "project_id" end + create_table "poll_answers", :force => true do |t| + t.integer "poll_questions_id" + t.text "answer_text" + t.integer "answer_position" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_questions", :force => true do |t| + t.string "question_title" + t.integer "question_type" + t.integer "is_necessary" + t.integer "polls_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_users", :force => true do |t| + t.integer "user_id" + t.integer "poll_id" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "poll_votes", :force => true do |t| + t.integer "user_id" + t.integer "poll_questions_id" + t.integer "poll_answers_id" + t.text "vote_text" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + + create_table "polls", :force => true do |t| + t.string "polls_name" + t.string "polls_type" + t.integer "polls_group_id" + t.integer "polls_status" + t.integer "user_id" + t.datetime "published_at" + t.datetime "closed_at" + t.datetime "created_at", :null => false + t.datetime "updated_at", :null => false + end + create_table "praise_tread_caches", :force => true do |t| t.integer "object_id", :null => false t.string "object_type"