Rails - how can I query the db w/o touching the sessions table
- by sa125
Hi -
I'm trying to provide a HTTP api to my app that queries a db that's read-only (for replication purposes). I find that my app crashes repeatedly when making a request b/c the call is trying to update the sessions table whenever I query the db. This doesn't happen when I return some text without hitting the database for info.
class APIController < AplicationController
def view
data = Product.find(params[:id]).to_json # will fail
data = { :one => 1, :two => 2 }.to_json # will succeed
respond_to do |format|
format.html { render :json => data }
end
end
end
How do I restrict it from touching the sessions table on this request (it's currently issuing an UPDATE on the updated_at field for that session). thanks.