I have submissions that might be in various states and wrote a method_missing override that allows me to check their state with calls like
submission.draft?
submission.published?
This works wonderfully.
I also, for various reasons that might not be so great, have a model called Packlet
that belongs_to a meeting and belongs_to a submission. However, I was surprised to find that
packlet.submission.draft?
returns a NoMethodError
. On the other hand, if I hard-code a #draft?
method into Submission
, the above method call works.
How do I get my method_missing methods to be recognized even when the instance is defined via an ActiveRecord association?