problem description
I now have a publish table that records the published data with the following fields:
publish_articlepublish_activity:
publish table has polymorphic association with other data tables . I need to get the specified amount of data from all the data published by a user, and perform Filter on the data, removing the data with is_drafts = 1 and visible = 0
.what methods have you tried
1 I have tried to change the table and move the fields used for judgment (is_drafts,visible) to the publish table, but in addition, my praise table and favorite table also have the same structure and function as the publish table, and I don"t want to have these fields in every table, so I feel that the fields are redundant, so this method is abandoned by me.
2 I have also tried to fetch the paged data from the publish table and then go to Filter to get detailed data, but the data after Filter does not reach the amount required by paging. So I gave up, too.
at present, there are only these two methods that can be thought of. How can you achieve the effect of paging and Filter data in the case of polymorphic association?