I think there may be something wrong with your model. Firstly I think you need
Is there a problem with the above? If one has a product
then product.category.attribute types will give one a collection of
attribute types relevant to that model. One could also use product.attributes to get a
collection of attributes, but since each attribute has an associated
attribute type one can also get the attribute types for a product by
this route. I am no database expert, so I may be wrong, but I suspect
that it is not a good idea to have two separate relationship routes between
models like this.
My other problem is that I am not sure what you are trying to achieve. Can you explain in a couple of sentences what data you wish to extract when the user clicks on the Book category for example?