Skip to content
This repository has been archived by the owner on Jul 4, 2021. It is now read-only.

How to create a database view to view multiple models like a single awesome model using the scenic gem.

Notifications You must be signed in to change notification settings

MikeRogers0-YouTube/Database-Views-With-Scenic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Use this template

Rails App

Welcome to your Ruby On Rails app.

Setup & Running Locally

Clone down the repo, install Docker & run:

$ docker-compose build
$ docker-compose run --rm web bin/setup
$ docker-compose up

This will build the docker image, then setup the bin/setup file which will run bundle, yarn & create the database.

Then navigate your browser to https://127.0.0.1:3000/ to see your site.

Running one of commands

To run a one off command, run it within the web service, e.g:

$ docker-compose run --rm web bin/rails db:migrate
$ docker-compose run --rm web bin/bundle
$ docker-compose run --rm web bin/yarn

Restoring a database

If you have an existing database dump in a file called latest.dump, you can restore it by turning on just the postgres service in one terminal tab, and running pg_restore in a secondary tab:

$ docker-compose up postgres
$ pg_restore --verbose --clean --no-acl --no-owner -j 2 -h localhost -d App_development --username postgres latest.dump

Tests

The template comes preconfigured with RSpec for tests, and comes with a GitHub Action to run them when you push to GitHub.

You can run RSpec locally by running:

$ docker-compose -f docker-compose.ci.yml run --rm test

Linting

This app uses Standard for Ruby and includes a GitHub Action to check future commits are up to standard.

Contributing

This was generated by Ruby-Starter-Kits/Docker-Rails-Generator, if you have any ideas please report them there :)

Usage

Feel free to use these as a starting point for your own Ruby on Rails project!

Resources

License

MIT

Copyright (c) 2020-present, Mike Rogers