I have a model (Query) which I use to, of all things, query the
database. This
is to enable raw SQL access. I want to ensure that db access using this
model
is read-only. Short of checking the sql query for ‘insert’ and ‘drop’
and
‘update’, is there a more rails-like way of doing this in my
app/models/query.rb
itself?
I have a model (Query) which I use to, of all things, query the database. This
is to enable raw SQL access. I want to ensure that db access using this model
is read-only. Short of checking the sql query for ‘insert’ and ‘drop’ and
‘update’, is there a more rails-like way of doing this in my app/models/query.rb
itself?
You could have it use a separate database connection that logs in as a
user with read-only access in your database.