Post.where() causing 500 error

@tgxworld Thanks that helped a bunch.

For the record I was doing a bunch of stuff that I SHOULD have known better…

  1. not splitting the string to an actual array (duh facepalm )
  2. 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!! :smiley: