0

I've read into Cancan and Pundit (also Devise) for managing users in a Rails App. But I wanted to know if something was possible.

Basically, I want to have users change/add lines in a table (using SQLite at the moment, but will be moving to SQL in the future - call them entries). But before it gets added to the actual table, it gets sent to the admin for approval. Then the admin can just hit 'approve' and the statement gets run.

I'm just confused about how to hold the statement and then when approved, the statement runs. Any information would be appreciated.

jimps
  • 65
  • 12

1 Answers1

0

By statement, do you mean that your users are actually writing the SQL themselves?

If not, I'd setup a second model identical to your first that acts like a queue of some sort that holds the proposed changes/additions. This way, you'll be able to compare the old and new statements if necessary, and, when approved, you'll be able to perform the create/update magic on your original model.

Hope this gives you some ideas!

David T
  • 83
  • 3