Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added ActiveRecord with the grape-active-record gem
- Loading branch information
Antony Ryabov
committed
Nov 24, 2015
1 parent
8b9ec95
commit 412226f
Showing
8 changed files
with
81 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -20,3 +20,6 @@ | ||
|
|
||
#ruby version and gem | #ruby version and gem | ||
.ruby-* | .ruby-* | ||
|
|||
#configs | |||
config/database.yml |
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,9 @@ | |||
require "bundler/setup" | |||
require "grape/activerecord/rake" | |||
|
|||
namespace :db do | |||
# Some db tasks require your app code to be loaded, or at least your gems | |||
task :environment do | |||
require_relative "app/core" | |||
end | |||
end |
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
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,40 @@ | |||
# MySQL. Versions 5.0+ are recommended. | |||
# | |||
# Install the MYSQL driver | |||
# gem install mysql2 | |||
# | |||
# Ensure the MySQL gem is defined in your Gemfile | |||
# gem 'mysql2' | |||
# | |||
# And be sure to use new-style password hashing: | |||
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |||
# | |||
default: &default | |||
adapter: mysql2 | |||
encoding: utf8 | |||
pool: 5 | |||
username: root | |||
password: | |||
host: 127.0.0.1 | |||
port: 3306 | |||
socket: /tmp/mysql.sock | |||
|
|||
development: | |||
<<: *default | |||
database: grape_rack_swagger_development | |||
|
|||
# Warning: The database defined as "test" will be erased and | |||
# re-generated from your development database when you run "rake". | |||
# Do not set this db to the same as development or production. | |||
test: | |||
<<: *default | |||
database: grape_rack_swagger_test | |||
|
|||
# Avoid production credentials in the repository, | |||
# instead read the configuration from the environment. | |||
# | |||
# Example: | |||
# mysql2://myuser:mypass@localhost/somedatabase | |||
# | |||
production: | |||
url: <%= ENV["DATABASE_URL"] %> |