Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
ARG RUBY_VERSION=3.4.4
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
35 changes: 35 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "fullstack_developer"

services:
rails-app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile

volumes:
- ../..:/workspaces:cached

# Overrides default command so things don't shut down after the process ends.
command: sleep infinity

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
depends_on:
- postgres

postgres:
image: postgres:16.1
restart: unless-stopped
networks:
- default
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

volumes:
postgres-data:
34 changes: 34 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// For format details, see https://containers.dev/implementors/json_reference/.
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "fullstack_developer",
"dockerComposeFile": "compose.yaml",
"service": "rails-app",
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/rails/devcontainer/features/activestorage": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {"moby":false},
"ghcr.io/rails/devcontainer/features/postgres-client": {}
},

"containerEnv": {
"KAMAL_REGISTRY_PASSWORD": "$KAMAL_REGISTRY_PASSWORD",
"DB_HOST": "postgres"
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3000, 5432],

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://containers.dev/implementors/json_reference/#remoteUser.
// "remoteUser": "root",


// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bin/setup --skip-server"
}
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ GEM
bindex (0.8.1)
bootsnap (1.18.6)
msgpack (~> 1.2)
brakeman (7.1.0)
brakeman (7.1.1)
racc
builder (3.3.0)
capybara (3.40.0)
Expand Down
5 changes: 5 additions & 0 deletions config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ default: &default
# For details on connection pooling, see Rails configuration guide
# https://guides.rubyonrails.org/configuring.html#database-pooling
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
<% if ENV["DB_HOST"] %>
host: <%= ENV["DB_HOST"] %>
username: postgres
password: postgres
<% end %>


development:
Expand Down
2 changes: 1 addition & 1 deletion coverage/.resultset.json
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,6 @@
]
}
},
"timestamp": 1762422350
"timestamp": 1762426100
}
}
6 changes: 3 additions & 3 deletions coverage/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<img src="./assets/0.13.2/loading.gif" alt="loading"/>
</div>
<div id="wrapper" class="hide">
<div class="timestamp">Generated <abbr class="timeago" title="2025-11-06T06:45:50-03:00">2025-11-06T06:45:50-03:00</abbr></div>
<div class="timestamp">Generated <abbr class="timeago" title="2025-11-06T07:48:20-03:00">2025-11-06T07:48:20-03:00</abbr></div>
<ul class="group_tabs"></ul>

<div id="content">
Expand Down Expand Up @@ -3140,7 +3140,7 @@ <h4>



<code class="ruby"> CSV.foreach(@file.path, headers: true) do |row| </code>
<code class="ruby"> CSV.foreach(@file.path, headers: true) do |row|</code>
</li>
</div>

Expand Down Expand Up @@ -3334,7 +3334,7 @@ <h4>



<code class="ruby"> </code>
<code class="ruby"></code>
</li>
</div>

Expand Down
13 changes: 4 additions & 9 deletions db/seeds.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
# This file should ensure the existence of records required to run the application in every environment (production,
# development, test). The code here should be idempotent so that it can be executed at any point in every environment.
# The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup).
#
# Example:
#
# ["Action", "Comedy", "Drama", "Horror"].each do |genre_name|
# MovieGenre.find_or_create_by!(name: genre_name)
# end
require 'factory_bot_rails'

FactoryBot.create(:user, role: :admin, email: 'admin@email.com', password: '123456')
FactoryBot.create(:user, email: 'user@email.com', password: '123456')
6 changes: 3 additions & 3 deletions spec/factories/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

after(:build) do |user|
user.avatar_image.attach(
io: File.open(Rails.root.join("spec", "fixtures", "files", "avatar_image.jpg")),
filename: "avatar_image.jpg",
content_type: "image/jpg"
io: File.open(Rails.root.join("public", "icon.png")),
filename: "icon.png",
content_type: "image/png"
)
end
end
Expand Down
Binary file added vendor/bundle/ruby/3.4.0/cache/brakeman-7.1.1.gem
Binary file not shown.
Loading