When chaining methods for BlockScore::Person
person = BlockScore::Person.retrieve("some_id")
person.question_sets.new
#=> NoMethodError: undefined method `new' for #<BlockScore::QuestionSet:0x007fb41c4fd3c8>
This is due to the person.question_sets returning a BlockScore::Collection that has a @target which is an instance of BlockScore::QuestionSet, but also, the BlockScore::Collection sends missing method calls directly to the instance. TheBlockScore::QuestionSet instance does not know to delegate this particular method to the self.class.
When chaining methods for
BlockScore::PersonThis is due to the
person.question_setsreturning aBlockScore::Collectionthat has a@targetwhich is an instance ofBlockScore::QuestionSet, but also, theBlockScore::Collectionsends missing method calls directly to the instance. TheBlockScore::QuestionSetinstance does not know todelegatethis particular method to theself.class.