Can you provide an example on how to properly index fields in the (automagically generated) "join" table that rails creates when 2 models are declared as habtm?
For example:
class Role < ActiveRecord::Base
has_and_belongs_to_many :users
end
class User < ActiveRecord::Base
has_and_belongs_to_many :roles
end
Then, how do I properly index the "role_id" and "user_id" columns in the automatically generated "roles_users" table?
It seems that cache-money requires index declarations in all models, but the problem is, there's no actual model file declared for the "roles_users" table. So, do I need to manually create the model file...? Or is there some other way to accomplish what I want?
Can you provide an example on how to properly index fields in the (automagically generated) "join" table that rails creates when 2 models are declared as habtm?
For example: class Role < ActiveRecord::Base
has_and_belongs_to_many :users
end
class User < ActiveRecord::Base
has_and_belongs_to_many :roles
end
Then, how do I properly index the "role_id" and "user_id" columns in the automatically generated "roles_users" table?
It seems that cache-money requires index declarations in all models, but the problem is, there's no actual model file declared for the "roles_users" table. So, do I need to manually create the model file...? Or is there some other way to accomplish what I want?
Thanks.