diff --git a/app/models/answer.rb b/app/models/answer.rb index 73e07e9..7127e78 100644 --- a/app/models/answer.rb +++ b/app/models/answer.rb @@ -7,7 +7,7 @@ has_and_belongs_to_many :options, join_table: "answers_options" - # TODO: REMOVE AND HANDLE ATTRIBUTE SECURITY IN THE CONTROLLER! +# TODO: REMOVE AND HANDLE ATTRIBUTE SECURITY IN THE CONTROLLER! attr_accessible :text, :plan_id, :question_id, :user_id, :option_ids, :plan, :user, :question, :as => [:default, :admin] diff --git a/app/models/comment.rb b/app/models/comment.rb index b4af9f9..a2e2ea2 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,12 +1,15 @@ class Comment < ActiveRecord::Base #associations between tables + belongs_to :user + belongs_to :plan belongs_to :question - #fields - attr_accessible :question_id, :text, :user_id, :archived, :plan_id, :archived_by, :as => [:default, :admin] +# TODO: REMOVE AND HANDLE ATTRIBUTE SECURITY IN THE CONTROLLER! + attr_accessible :question_id, :text, :user_id, :archived, :plan_id, :archived_by, + :user, :plan, :question, :as => [:default, :admin] - + validates :user, :question, :plan, :text, presence: true def to_s "#{text}"