我不知道你们是否会发生这种情况,但是当'tagger_id'和tagger_type列都被填写时意味着所有列都被填写在taggings表中,当你这样做时:
record.category_list 其中记录有acts_as_taggable_on :category
它打印为空。
删除 tagger_id 和 tagger_type 它将打印 category_list 查找。
请注意,这样做:
record.taggings 结果为行,所以我不明白为什么它打印为空。
还,
record.categories_from(account) 导致未定义的方法。在自述文件中它说做@some_path.locations_from 但似乎函数deos 不存在并且足够真实我在代码中搜索“_from”没有找到任何东西。