Ribica front office API
Getting started:
- install postgresql and libraries (for native 'pg' gem to be able to compile)
- run
bundle install - create postgresql user protected with password
- create postgresql database
- copy config.rb.example to config.rb and change the information inside of it
- run
rake db:schema:load - run
gem install rerun
Running dev server (with autoreloading)
- run
rerun ruby app.rb
Generating migrations
Sinatra has a different syntax than rails to generate migration:
rake db:create_migration NAME=create_categories
Handling shared models
Some of models will necesarrily be shared between front and back office. Migrations for those models must be in front office and back office will just have a model file with custom code if needed.
When generating active scaffold - migration is generated by default so it needs to be removed before using it.