MatriculaWeb - Sec Edu DF
- School:
$ rails g scaffold School name:string code:string administrative_type:string total_rooms:integer used_rooms:integer amount_employees:integer user:belongs_to
- KnowledgeAreas
$ rails g scaffold KnowledgeArea name:string knowledge_area:belongs_to
- Subject (workload = total time of it subject):
$ rails g scaffold Subject name:string description:string workload:integer online_link:string class_schedule:string user:belongs_to knowledge_area:belongs_to
- Subscription:
$ rails g scaffold Subscription access_type:string user:belongs_to subject:belongs_to
Clear Database: $ rails d scaffold School && rails d scaffold Subject && rails d scaffold Subscription
*Remember to update add_school_ref_to_user migration timestamp
Localhost HTTPS para testes como o do facebook: https://rossta.net/blog/local-ssl-for-rails-5.html#resolve-a-domain-name-to-localhost --> O SSL QUE FUNCIONOU FOI O DO HEROKU: https://devcenter.heroku.com/articles/ssl-certificate-self --> O tutorial do SSL do heroku está no dropbox
Trust SSL: sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain config/ssl/server.crt
Executando rails com SSL: rails s -b 'ssl://0.0.0.0:3000?key=config/ssl/server.key&cert=config/ssl/server.crt'
puma -b 'ssl://0.0.0.0:3000?key=config/ssl/server.key&cert=config/ssl/server.crt'
RUBY MINE CONFIG: Server Arguments = -b "ssl://0.0.0.0:3000?key=config/ssl/server.key&cert=config/ssl/server.crt"
--> IF locahost takes so long, it is HTTP not HTTPS, CHECK IT
Add ao Server Arguments: -b "ssl://localhost:3000?key=config/ssl/server.key&cert=config/ssl/server.crt"
README-wsl-rubymine.md
- Install
sudo apt update sudo apt install postgresql postgresql-contrib
- LogIn
sudo -i -u postgres
-
Status Check
service --status-all
-
Start MySQL
service mysql start
-
Start Postgres
service postgresql start
-
ActiveStorage Upload files: /config/storage.yml
- Install:
brew doctor && brew update && brew install postgresql postgres
- Start:
brew services start postgresql
- Access postgres and alter:
- Access:
psql postgres
- Inside database:
CREATE ROLE postgres WITH LOGIN PASSWORD 'postgres';
ALTER ROLE postgres CREATEDB;
ALTER USER postgres CREATEDB;
- exit
\q
CREATE ROLE pguser WITH LOGIN PASSWORD 'pguser';
ALTER ROLE pguser CREATEDB;
ALTER USER pguser CREATEDB;
GRANT ALL PRIVILEGES ON DATABASE schema_migrations to pguser;
- exit
\q
- Access:
- install the gem
- write your scheduler.rb file
- push to the remote server
- login to the remote server (for example with ssh)
- see if whenever is good uploaded by running in terminal: whenever
- update whenever crontab by running: whenever --update-crontab --set environment=development
- restart the server crontab (for example in Ubuntu server): sudo service cron restart
- check if crontab is good implemented on the server: crontab -l