From 34834889d8b1dc055aa6869e004c29a024bec35d Mon Sep 17 00:00:00 2001 From: voodoorai2000 Date: Tue, 23 Apr 2019 13:18:28 +0200 Subject: [PATCH] Fix Answer's class conflict We have two models called `Answer`: The `Answer` model and the `Poll::Answer` model. This conflict ocurrs when trying to create a user generated poll for a proposal. from the Dashboard. In that case we are getting an exception, only in the development environment, as the class `Answer` is loaded before the class `Poll::Answer` which is the one we want to use. With this commit we are explicitly requiring the correct model, solving the class conflict. --- app/models/poll.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/models/poll.rb b/app/models/poll.rb index b4e69a7bc..4aca4ee25 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -1,4 +1,6 @@ class Poll < ApplicationRecord + require_dependency "poll/answer" + include Imageable acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases