Skip to content

Commit

Permalink
Switched development and test databases to sqlite3, added bcrypt and …
Browse files Browse the repository at this point in the history
…image-processing
  • Loading branch information
Otoniel Reyes Galay committed Aug 17, 2022
1 parent 02fbbcf commit 1b62b61
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 79 deletions.
12 changes: 7 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ gem "rails", "~> 7.0.3", ">= 7.0.3.1"
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"

# Use postgresql as the database for Active Record
gem "pg", "~> 1.1"

# Use the Puma web server [https://github.com/puma/puma]
gem "puma", "~> 5.0"

Expand All @@ -34,7 +31,7 @@ gem "jbuilder"
# gem "kredis"

# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
# gem "bcrypt", "~> 3.1.7"
gem "bcrypt", "~> 3.1.7"

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ]
Expand All @@ -46,11 +43,12 @@ gem "bootsnap", require: false
# gem "sassc-rails"

# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
# gem "image_processing", "~> 1.2"
gem "image_processing", "~> 1.2"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[ mri mingw x64_mingw ]
gem "sqlite3"
end

group :development do
Expand All @@ -70,3 +68,7 @@ group :test do
gem "selenium-webdriver"
gem "webdrivers"
end

group :production do
gem "pg", "~> 1.1"
end
12 changes: 12 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ GEM
tzinfo (~> 2.0)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
bcrypt (3.1.18)
bindex (0.8.1)
bootsnap (1.13.0)
msgpack (~> 1.2)
Expand All @@ -89,10 +90,14 @@ GEM
reline (>= 0.3.1)
digest (3.1.0)
erubi (1.11.0)
ffi (1.15.5)
globalid (1.0.0)
activesupport (>= 5.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
image_processing (1.12.2)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
importmap-rails (1.1.5)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
Expand All @@ -110,6 +115,7 @@ GEM
marcel (1.0.2)
matrix (0.4.2)
method_source (1.0.0)
mini_magick (4.11.0)
mini_mime (1.1.2)
minitest (5.16.3)
msgpack (1.5.4)
Expand Down Expand Up @@ -169,6 +175,8 @@ GEM
reline (0.3.1)
io-console (~> 0.5)
rexml (3.2.5)
ruby-vips (2.1.4)
ffi (~> 1.12)
rubyzip (2.3.2)
selenium-webdriver (4.4.0)
childprocess (>= 0.5, < 5.0)
Expand All @@ -182,6 +190,7 @@ GEM
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.4)
stimulus-rails (1.1.0)
railties (>= 6.0.0)
strscan (3.0.4)
Expand Down Expand Up @@ -214,16 +223,19 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
bcrypt (~> 3.1.7)
bootsnap
capybara
debug
image_processing (~> 1.2)
importmap-rails
jbuilder
pg (~> 1.1)
puma (~> 5.0)
rails (~> 7.0.3, >= 7.0.3.1)
selenium-webdriver
sprockets-rails
sqlite3
stimulus-rails
turbo-rails
tzinfo-data
Expand Down
78 changes: 4 additions & 74 deletions config/database.yml
Original file line number Diff line number Diff line change
@@ -1,84 +1,14 @@
# PostgreSQL. Versions 9.3 and up are supported.
#
# Install the pg driver:
# gem install pg
# On macOS with Homebrew:
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
# On macOS with MacPorts:
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
# On Windows:
# gem install pg
# Choose the win32 build.
# Install PostgreSQL and put its /bin directory on your path.
#
# Configure Using Gemfile
# gem "pg"
#
default: &default
adapter: postgresql
encoding: unicode
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>

development:
<<: *default
database: burton_development

# The specified database role being used to connect to postgres.
# To create additional roles in postgres see `$ createuser --help`.
# When left blank, postgres will use the default role. This is
# the same name as the operating system user running Rails.
#username: burton

# The password associated with the postgres role (username).
#password:

# Connect on a TCP socket. Omitted by default since the client uses a
# domain socket that doesn't need configuration. Windows does not have
# domain sockets, so uncomment these lines.
#host: localhost

# The TCP port the server listens on. Defaults to 5432.
# If your server runs on a different port number, change accordingly.
#port: 5432

# Schema search path. The server defaults to $user,public
#schema_search_path: myapp,sharedapp,public

# Minimum log levels, in increasing order:
# debug5, debug4, debug3, debug2, debug1,
# log, notice, warning, error, fatal, and panic
# Defaults to warning.
#min_messages: notice

# 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.
adapter: sqlite3
database: db/development.sqlite3
test:
<<: *default
database: burton_test

# As with config/credentials.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 or a full connection URL as an environment
# variable when you boot the app. For example:
#
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
#
# If the connection URL is provided in the special DATABASE_URL environment
# variable, Rails will automatically merge its configuration values on top of
# the values provided in this file. Alternatively, you can specify a connection
# URL environment variable explicitly:
#
# production:
# url: <%= ENV["MY_APP_DATABASE_URL"] %>
#
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
# for a full overview on how database connection configuration can be specified.
#
adapter: sqlite3
database: db/test.sqlite3
production:
<<: *default
database: burton_production
Expand Down

0 comments on commit 1b62b61

Please sign in to comment.