This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"info":{"description":"Poliedro API","title":"Atena API","version":"0.1.0"},"openapi":"3.0.0","paths":{"/api/v1/schools":{"get":{"description":"","parameters":[{"description":"","in":"header","name":"content-type","required":false,"schema":{"type":"string"}},{"description":"","in":"header","name":"accept","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/vnd":{"schema":{"properties":{"data":{"description":"","type":"string"},"jsonapi":{"description":"","type":"string"}},"type":"object"}}},"description":"index/1 returns a list of schools that the user has access","headers":{"cache-control":{"schema":{"type":"string"}},"content-type":{"schema":{"type":"string"}},"x-request-id":{"schema":{"type":"string"}}}}},"summary":""}}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################## | |
$ sudo apt-get install cgroup-tools | |
################################################## | |
# /etc/default/grub | |
GRUB_CMDLINE_LINUX_DEFAULT="quiet cgroup_enable=memory swapaccount=1" | |
################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem "lograge" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/application.rb | |
module MyApp | |
class Application < Rails::Application | |
def config.database_configuration | |
config = super | |
ActiveRecord::Base.establish_connection(config["control"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
before_filter :select_database | |
def select_database | |
if Rails.env == "production" | |
unless request.subdomain.empty? | |
begin | |
subdomain = request.subdomains.first | |
config = ActiveRecord::Base.configurations[subdomain] | |
if config | |
ActiveRecord::Base.establish_connection(config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Fernando Almeida | |
email = fernando@fernandoalmeida.net | |
[color] | |
ui = auto | |
[core] | |
editor = vim | |
excludesfile = .gitignore-global | |
[alias] | |
br = branch |