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:
@@ -1,4 +1,6 @@
|
||||
class Poll < ApplicationRecord
|
||||
require_dependency "poll/answer"
|
||||
|
||||
include Imageable
|
||||
acts_as_paranoid column: :hidden_at
|
||||
include ActsAsParanoidAliases
|
||||
|
||||
Reference in New Issue
Block a user