Adjust accessors to pull values from attributes if they exist
This has to be done because using multiple queries in a select statement does not automatically map into an ActiveRecord model and the values we want wait in the `self.attributes` hash.
This commit is contained in:
parent
997953565f
commit
b4cfc95c83
|
@ -71,4 +71,8 @@ class Answer < ApplicationRecord
|
||||||
def long? = content.length > SHORT_ANSWER_MAX_LENGTH
|
def long? = content.length > SHORT_ANSWER_MAX_LENGTH
|
||||||
|
|
||||||
def pinned? = pinned_at.present?
|
def pinned? = pinned_at.present?
|
||||||
|
|
||||||
|
def has_reacted = self.attributes["has_reacted"] || false
|
||||||
|
|
||||||
|
def is_subscribed = self.attributes["is_subscribed"] || false
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue