@tgxworld Thanks that helped a bunch.
For the record I was doing a bunch of stuff that I SHOULD have known better…
- not splitting the string to an actual array (duh facepalm )
- your request seems to have fix the syntax issues (woot)
final code
uid = params["uid"].split(",")
tid = params["tid"].split(",")
posts = Post.where('user_id IN (?) OR topic_id IN (?)', uid, tid )
.order(created_at: :desc)
.limit(params["total"])
.offset(params["start"])
obj = {follow_posts: posts }
render json: obj
Massive thanks!! ![]()