Instance Method Details

#make_relation! ⇒ Object

120
121
122
123
124
125
126
127
128
129
130
131
132
133

# File 'lib/evil_query.rb', line 120defmake_relation!returnquerents_postsif@person==@querent.person# persons_private_visibilities and persons_public_posts have no limit which is making shareable_ids gigantic.
# perhaps they should the arrays should be merged and sorted
# then the query at the bottom of this method can be paginated or something?
shareable_ids=contact.present??fetch_ids!(persons_private_visibilities,"share_visibilities.shareable_id"):[]shareable_ids+=fetch_ids!(persons_public_posts,table_name+".id")@class.where(:id=>shareable_ids,:pending=>false).select('DISTINCT '+table_name+'.*').order(table_name+".created_at DESC")end