I'm refactoring a rails app that currently uses a database and ActiveRecord so that instead of of the database, it uses a JSON API (Sinatra).
What would be the best way to refactor the models? The API will return all the same information as the database used to. Infact it IS the same database, but for scalability and multiple apps requiring access to the data, we needed to turn it into an API. Ideally only the Models will need to change and ideally I can keep some validation in the rails app.
How can I change the models so they retrieve and save their instances via API calls rather than ActiveRecord database calls?
I think you are looking for something like ActiveResource