You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: