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.
This commit is contained in:
voodoorai2000
2019-04-23 13:18:28 +02:00
committed by decabeza
parent 93972eeb33
commit 34834889d8

View File

@@ -1,4 +1,6 @@
class Poll < ApplicationRecord
require_dependency "poll/answer"
include Imageable
acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases