I've got a model setup like the following:
class user's_maya: item Has_many: word ,: through = & gt; : The value of items in the end square of items is_to: user population_keyword: word default_scope, where (: active => true) are the words of the end squared_me: item ending The problem is, default_scope is not being applied to the following associations:
user.words Instead of this SQL: < Pre> select 'word' `` `` `` `` `` `` `` `` `item`` `` `` > I get this SQL in the logs: select 'words'. * `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` `` ` A regular model and its hair work for the union, but not to join the tables. What is the correct way of joining the table without joining it to work? Does anyone exist? Answers have been found with the help of DRF from Rabbi-on-Rail #
In the user category, set many relationships to:
has_many: words ,: through = & gt; : Items, terms = & gt; {"Items activated" = & gt; The reason for this is that although the connection between joining a habtm between the user and the word, the user model called the phone model is not really filled. So you have to implement the scope of the association in the user model. Hope someone got help.
Comments
Post a Comment