diff --git a/modules/openapi-generator/src/main/resources/rails5/Gemfile b/modules/openapi-generator/src/main/resources/rails5/Gemfile index a46942406d17..1fddd01a4290 100644 --- a/modules/openapi-generator/src/main/resources/rails5/Gemfile +++ b/modules/openapi-generator/src/main/resources/rails5/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' -# Use mysql as the database for Active Record -gem 'mysql2', '>= 0.3.18', '< 0.5' +# Use sqlite as the database for Active Record +gem 'sqlite3', '~> 1.3' # Use Puma as the app server gem 'puma', '~> 3.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder diff --git a/modules/openapi-generator/src/main/resources/rails5/database.yml b/modules/openapi-generator/src/main/resources/rails5/database.yml index e536d9f37dc0..025d62a8d810 100644 --- a/modules/openapi-generator/src/main/resources/rails5/database.yml +++ b/modules/openapi-generator/src/main/resources/rails5/database.yml @@ -1,54 +1,22 @@ -# MySQL. Versions 5.0 and up are supported. -# -# 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.7/en/old-client.html -# -default: &default - adapter: mysql2 - encoding: utf8 - pool: 5 - username: root - password: - socket: /tmp/mysql.sock - +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) development: - <<: *default - database: api_demo_development + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 # 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: api_demo_test + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# production: - <<: *default - database: api_demo_production - username: api_demo - password: <%= ENV['API_DEMO_DATABASE_PASSWORD'] %> + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000 diff --git a/samples/server/petstore/rails5/.openapi-generator/VERSION b/samples/server/petstore/rails5/.openapi-generator/VERSION index 096bf47efe31..ad121e8340e0 100644 --- a/samples/server/petstore/rails5/.openapi-generator/VERSION +++ b/samples/server/petstore/rails5/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +3.0.1-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/rails5/Gemfile b/samples/server/petstore/rails5/Gemfile index a46942406d17..1fddd01a4290 100644 --- a/samples/server/petstore/rails5/Gemfile +++ b/samples/server/petstore/rails5/Gemfile @@ -3,8 +3,8 @@ source 'https://rubygems.org' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0' -# Use mysql as the database for Active Record -gem 'mysql2', '>= 0.3.18', '< 0.5' +# Use sqlite as the database for Active Record +gem 'sqlite3', '~> 1.3' # Use Puma as the app server gem 'puma', '~> 3.0' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder diff --git a/samples/server/petstore/rails5/config/database.yml b/samples/server/petstore/rails5/config/database.yml index e536d9f37dc0..025d62a8d810 100644 --- a/samples/server/petstore/rails5/config/database.yml +++ b/samples/server/petstore/rails5/config/database.yml @@ -1,54 +1,22 @@ -# MySQL. Versions 5.0 and up are supported. -# -# 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.7/en/old-client.html -# -default: &default - adapter: mysql2 - encoding: utf8 - pool: 5 - username: root - password: - socket: /tmp/mysql.sock - +# SQLite version 3.x +# gem install sqlite3-ruby (not necessary on OS X Leopard) development: - <<: *default - database: api_demo_development + adapter: sqlite3 + database: db/development.sqlite3 + pool: 5 + timeout: 5000 # 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: api_demo_test + adapter: sqlite3 + database: db/test.sqlite3 + pool: 5 + timeout: 5000 -# As with config/secrets.yml, you never want to store sensitive information, -# like your database password, in your source code. If your source code is -# ever seen by anyone, they now have access to your database. -# -# Instead, provide the password as a unix environment variable when you boot -# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database -# for a full rundown on how to provide these environment variables in a -# production deployment. -# -# On Heroku and other platform providers, you may have a full connection URL -# available as an environment variable. For example: -# -# DATABASE_URL="mysql2://myuser:mypass@localhost/somedatabase" -# -# You can use this database configuration with: -# -# production: -# url: <%= ENV['DATABASE_URL'] %> -# production: - <<: *default - database: api_demo_production - username: api_demo - password: <%= ENV['API_DEMO_DATABASE_PASSWORD'] %> + adapter: sqlite3 + database: db/production.sqlite3 + pool: 5 + timeout: 5000