Closed wbotelhos closed 7 years ago
What are the actable
and acts_as
models in this example?
Hi,
Event is actable
and Exame
is acts_as :event
.
I edited the question for a better view. (:
And what exactly is the problem you run into? AFAICS it's the expected behavior that trailable_type
is "event", since it's the Event
class that has the association.
You can still access the trails of an exam with exam.trails
, right?
Just yesterday I added a spec for this case since I wanted to make sure it behaves as expected:
https://github.com/hzamani/active_record-acts_as/commit/6040ca652aa32f9cf4803956e5be85a8114fed20
I already changed the Trail
to a specific ExamTrail
. But I guess that is possible exam.trails
, but for some reason, that I can't remember, I needed to change. In a future I try again and comment here. Thank you! (:
As you can see, if the
has_many :trails
stay on parent class, it gets thetrailable_type
asEvent
, notExam
. There is some way to detect from where thehas_many
was called to set this type?I have a
has_one
that works fine:Thank you.