diff --git a/app/models/comment.rb b/app/models/comment.rb index 269dac25d..16bb207d3 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -19,8 +19,6 @@ class Comment < ActiveRecord::Base belongs_to :commentable, -> { with_hidden }, polymorphic: true, counter_cache: true belongs_to :user, -> { with_hidden } - has_many :votes, -> { for_comments }, foreign_key: 'votable_id' - before_save :calculate_confidence_score scope :for_render, -> { with_hidden.includes(user: :organization) } diff --git a/app/models/debate.rb b/app/models/debate.rb index 56adb4f80..8254bdc10 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -17,7 +17,6 @@ class Debate < ActiveRecord::Base belongs_to :author, -> { with_hidden }, class_name: 'User', foreign_key: 'author_id' belongs_to :geozone has_many :comments, as: :commentable - has_many :votes, -> { for_debates }, foreign_key: 'votable_id' validates :title, presence: true validates :description, presence: true diff --git a/app/models/proposal.rb b/app/models/proposal.rb index 09741f5f9..c69fe4194 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -19,7 +19,6 @@ class Proposal < ActiveRecord::Base belongs_to :geozone has_many :comments, as: :commentable has_many :proposal_notifications - has_many :votes, -> { for_proposals }, foreign_key: 'votable_id' validates :title, presence: true validates :question, presence: true diff --git a/config/api.yml b/config/api.yml index 669602611..d007202cb 100644 --- a/config/api.yml +++ b/config/api.yml @@ -22,7 +22,7 @@ Debate: geozone: Geozone comments: [Comment] public_author: User - votes: [Vote] + votes_for: [Vote] tags: ["ActsAsTaggableOn::Tag"] Proposal: fields: @@ -45,7 +45,7 @@ Proposal: comments: [Comment] proposal_notifications: [ProposalNotification] public_author: User - votes: [Vote] + votes_for: [Vote] tags: ["ActsAsTaggableOn::Tag"] Comment: fields: @@ -60,7 +60,7 @@ Comment: ancestry: string confidence_score: integer public_author: User - votes: [Vote] + votes_for: [Vote] Geozone: fields: id: integer