我正在尝试编写一个测试用例,我正在寻找一种更简洁的方法来获取与模型关联的嵌套属性
例如
class Category < ActiveRecord::Base
accepts_nested_attributes_for :devices, :books
#other association and code is not written here
end
我预计
$ Category.get_nested_attributes #this is a dummy method
$ ["devices","books"] #this is the return i expect
是否有任何已经存在的辅助方法?如果是,请告诉我。:)
谢谢