Compare commits
23 commits
main
...
gitea-acti
Author | SHA1 | Date | |
---|---|---|---|
482ab7c877 | |||
eeeaf4b238 | |||
fcbbc0d0e8 | |||
2edcc17a7c | |||
2dbeb6c45c | |||
c9819bfa93 | |||
fa3db2e586 | |||
3ba6711cfe | |||
804d074c0b | |||
e19b71652d | |||
8bc962a6fe | |||
fc68fb41da | |||
80906614d5 | |||
c69301eb6c | |||
039583ac5c | |||
5054a28ed8 | |||
d3c6fac69b | |||
b0ec03f90d | |||
ad222c229e | |||
ce376c3a50 | |||
97728e4cff | |||
0aa6f8dc3e | |||
87b5350f1f |
92 changed files with 569 additions and 2289 deletions
|
@ -1,30 +0,0 @@
|
|||
name: Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "**"
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: cth-ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Read .ruby-version file
|
||||
id: ruby
|
||||
run: echo "version=$(cat .ruby-version)" >> $GITHUB_OUTPUT
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
build-args: |
|
||||
RUBY_VERSION=${{ steps.ruby.outputs.version }}
|
||||
tags: |
|
||||
docker.atomaka.com/budget:latest
|
||||
docker.atomaka.com/budget:${{gitea.sha}}
|
||||
- name: Deploy to server
|
||||
run: |
|
||||
curl --oauth2-bearer ${{ secrets.WATCHTOWER_TOKEN }} \
|
||||
${{ secrets.WATCHTOWER_HOST }}/v1/update?images=docker.atomaka.com/budget
|
|
@ -5,11 +5,19 @@ on:
|
|||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: cth-ubuntu-latest
|
||||
runs-on: ruby-latest
|
||||
steps:
|
||||
- name: Install Node
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install git ca-certificates curl gnupg --yes
|
||||
mkdir -p /etc/apt/keyrings
|
||||
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_20.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
|
||||
apt-get update
|
||||
apt-get install -y nodejs
|
||||
- uses: actions/checkout@v4
|
||||
- uses: https://github.com/ruby/setup-ruby@bfefad842bb982ff05b233bcbc1571d97a87e69f
|
||||
- uses: actions/cache@v4
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||
|
@ -22,9 +30,7 @@ jobs:
|
|||
- name: autoload
|
||||
run: bin/rails zeitwerk:check
|
||||
- name: lint
|
||||
run: bin/rubocop
|
||||
- name: security
|
||||
run: bin/brakeman
|
||||
run: bin/bundle exec standardrb
|
||||
- name: test
|
||||
run: |
|
||||
bin/rails assets:precompile
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# Omakase Ruby styling for Rails
|
||||
inherit_gem:
|
||||
rubocop-rails-omakase: rubocop.yml
|
||||
|
||||
# Your own specialized rules go here
|
|
@ -1 +1 @@
|
|||
3.4.1
|
||||
3.3.1
|
||||
|
|
40
Dockerfile
40
Dockerfile
|
@ -1,36 +1,25 @@
|
|||
# syntax = docker/dockerfile:1
|
||||
|
||||
# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand:
|
||||
# docker build -t my-app .
|
||||
# docker run -d -p 80:80 -p 443:443 --name my-app -e RAILS_MASTER_KEY=<value from config/master.key> my-app
|
||||
|
||||
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
|
||||
|
||||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
|
||||
ARG RUBY_VERSION=3.4.1
|
||||
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base
|
||||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
|
||||
ARG RUBY_VERSION=3.2.2
|
||||
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
|
||||
|
||||
# Rails app lives here
|
||||
WORKDIR /rails
|
||||
|
||||
# Install base packages
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y curl libjemalloc2 libsqlite3-0 libvips && \
|
||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
||||
|
||||
# Set production environment
|
||||
ENV RAILS_ENV="production" \
|
||||
BUNDLE_DEPLOYMENT="1" \
|
||||
BUNDLE_PATH="/usr/local/bundle" \
|
||||
BUNDLE_WITHOUT="development"
|
||||
|
||||
|
||||
# Throw-away build stage to reduce size of final image
|
||||
FROM base AS build
|
||||
FROM base as build
|
||||
|
||||
# Install packages needed to build gems
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y build-essential git pkg-config && \
|
||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
||||
apt-get install --no-install-recommends -y build-essential git libvips pkg-config
|
||||
|
||||
# Install application gems
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
|
@ -38,6 +27,7 @@ RUN bundle install && \
|
|||
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
|
||||
bundle exec bootsnap precompile --gemfile
|
||||
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
|
@ -48,20 +38,24 @@ RUN bundle exec bootsnap precompile app/ lib/
|
|||
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
|
||||
|
||||
|
||||
|
||||
|
||||
# Final stage for app image
|
||||
FROM base
|
||||
|
||||
# Install packages needed for deployment
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install --no-install-recommends -y curl libsqlite3-0 libvips libjemalloc2 && \
|
||||
rm -rf /var/lib/apt/lists /var/cache/apt/archives
|
||||
|
||||
# Copy built artifacts: gems, application
|
||||
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}"
|
||||
COPY --from=build /usr/local/bundle /usr/local/bundle
|
||||
COPY --from=build /rails /rails
|
||||
|
||||
# Run and own only the runtime files as a non-root user for security
|
||||
RUN groupadd --system --gid 1000 rails && \
|
||||
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
|
||||
RUN useradd rails --create-home --shell /bin/bash && \
|
||||
chown -R rails:rails db log storage tmp
|
||||
USER 1000:1000
|
||||
USER rails:rails
|
||||
|
||||
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
|
||||
|
||||
# Entrypoint prepares the database.
|
||||
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
|
||||
|
|
53
Gemfile
53
Gemfile
|
@ -1,67 +1,32 @@
|
|||
source "https://rubygems.org"
|
||||
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
|
||||
|
||||
ruby file: ".ruby-version"
|
||||
|
||||
gem "rails", github: "rails/rails", branch: "main"
|
||||
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
|
||||
gem "propshaft"
|
||||
# Use sqlite3 as the database for Active Record
|
||||
gem "sqlite3", ">= 1.4"
|
||||
# Use the Puma web server [https://github.com/puma/puma]
|
||||
gem "puma", ">= 5.0"
|
||||
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
|
||||
gem "rails", "7.1.3.2"
|
||||
gem "sprockets-rails"
|
||||
gem "sqlite3", "< 2"
|
||||
gem "puma"
|
||||
gem "importmap-rails"
|
||||
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
|
||||
gem "turbo-rails"
|
||||
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
|
||||
gem "stimulus-rails"
|
||||
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
|
||||
gem "jbuilder"
|
||||
# Use Redis adapter to run Action Cable in production
|
||||
# gem "redis", ">= 4.0.1"
|
||||
|
||||
gem "solid_cable"
|
||||
gem "solid_cache"
|
||||
gem "solid_queue"
|
||||
|
||||
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
|
||||
# gem "kredis"
|
||||
|
||||
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
|
||||
gem "bcrypt"
|
||||
|
||||
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
|
||||
gem "tzinfo-data", platforms: %i[ windows jruby ]
|
||||
|
||||
# Reduces boot times through caching; required in config/boot.rb
|
||||
gem "bootsnap", require: false
|
||||
|
||||
# Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
|
||||
# gem "kamal", require: false
|
||||
|
||||
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
|
||||
# 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 windows ], require: "debug/prelude"
|
||||
|
||||
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
|
||||
gem "brakeman", require: false
|
||||
|
||||
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
|
||||
gem "rubocop-rails-omakase", require: false
|
||||
gem "debug", platforms: %i[mri mingw x64_mingw]
|
||||
end
|
||||
|
||||
group :development do
|
||||
# Use console on exceptions pages [https://github.com/rails/web-console]
|
||||
gem "standard"
|
||||
gem "web-console"
|
||||
end
|
||||
|
||||
group :test do
|
||||
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
|
||||
gem "capybara"
|
||||
gem "selenium-webdriver"
|
||||
gem "webdrivers"
|
||||
end
|
||||
|
||||
gem "tailwindcss-rails", "~> 3.3.1"
|
||||
gem "tailwindcss-rails", "~> 2.0"
|
||||
|
|
402
Gemfile.lock
402
Gemfile.lock
|
@ -1,118 +1,89 @@
|
|||
GIT
|
||||
remote: https://github.com/rails/rails.git
|
||||
revision: 57c24948eb5cc9e5f9a4cecb6f2060f53e2246e1
|
||||
branch: main
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
actioncable (8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
actioncable (7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
nio4r (~> 2.0)
|
||||
websocket-driver (>= 0.6.1)
|
||||
zeitwerk (~> 2.6)
|
||||
actionmailbox (8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
activejob (= 8.1.0.alpha)
|
||||
activerecord (= 8.1.0.alpha)
|
||||
activestorage (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
mail (>= 2.8.0)
|
||||
actionmailer (8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
actionview (= 8.1.0.alpha)
|
||||
activejob (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
mail (>= 2.8.0)
|
||||
actionmailbox (7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
activejob (= 7.1.3.2)
|
||||
activerecord (= 7.1.3.2)
|
||||
activestorage (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
mail (>= 2.7.1)
|
||||
net-imap
|
||||
net-pop
|
||||
net-smtp
|
||||
actionmailer (7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
actionview (= 7.1.3.2)
|
||||
activejob (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
mail (~> 2.5, >= 2.5.4)
|
||||
net-imap
|
||||
net-pop
|
||||
net-smtp
|
||||
rails-dom-testing (~> 2.2)
|
||||
actionpack (8.1.0.alpha)
|
||||
actionview (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
actionpack (7.1.3.2)
|
||||
actionview (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
nokogiri (>= 1.8.5)
|
||||
racc
|
||||
rack (>= 2.2.4)
|
||||
rack-session (>= 1.0.1)
|
||||
rack-test (>= 0.6.3)
|
||||
rails-dom-testing (~> 2.2)
|
||||
rails-html-sanitizer (~> 1.6)
|
||||
useragent (~> 0.16)
|
||||
actiontext (8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
activerecord (= 8.1.0.alpha)
|
||||
activestorage (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
actiontext (7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
activerecord (= 7.1.3.2)
|
||||
activestorage (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
globalid (>= 0.6.0)
|
||||
nokogiri (>= 1.8.5)
|
||||
actionview (8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
actionview (7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
builder (~> 3.1)
|
||||
erubi (~> 1.11)
|
||||
rails-dom-testing (~> 2.2)
|
||||
rails-html-sanitizer (~> 1.6)
|
||||
activejob (8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
activejob (7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
globalid (>= 0.3.6)
|
||||
activemodel (8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
activerecord (8.1.0.alpha)
|
||||
activemodel (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
activemodel (7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
activerecord (7.1.3.2)
|
||||
activemodel (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
timeout (>= 0.4.0)
|
||||
activestorage (8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
activejob (= 8.1.0.alpha)
|
||||
activerecord (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
activestorage (7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
activejob (= 7.1.3.2)
|
||||
activerecord (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
marcel (~> 1.0)
|
||||
activesupport (8.1.0.alpha)
|
||||
activesupport (7.1.3.2)
|
||||
base64
|
||||
benchmark (>= 0.3)
|
||||
bigdecimal
|
||||
concurrent-ruby (~> 1.0, >= 1.3.1)
|
||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||
connection_pool (>= 2.2.5)
|
||||
drb
|
||||
i18n (>= 1.6, < 2)
|
||||
logger (>= 1.4.2)
|
||||
minitest (>= 5.1)
|
||||
securerandom (>= 0.3)
|
||||
tzinfo (~> 2.0, >= 2.0.5)
|
||||
uri (>= 0.13.1)
|
||||
rails (8.1.0.alpha)
|
||||
actioncable (= 8.1.0.alpha)
|
||||
actionmailbox (= 8.1.0.alpha)
|
||||
actionmailer (= 8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
actiontext (= 8.1.0.alpha)
|
||||
actionview (= 8.1.0.alpha)
|
||||
activejob (= 8.1.0.alpha)
|
||||
activemodel (= 8.1.0.alpha)
|
||||
activerecord (= 8.1.0.alpha)
|
||||
activestorage (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 8.1.0.alpha)
|
||||
railties (8.1.0.alpha)
|
||||
actionpack (= 8.1.0.alpha)
|
||||
activesupport (= 8.1.0.alpha)
|
||||
irb (~> 1.13)
|
||||
rackup (>= 1.0.0)
|
||||
rake (>= 12.2)
|
||||
thor (~> 1.0, >= 1.2.2)
|
||||
zeitwerk (~> 2.6)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.8.7)
|
||||
public_suffix (>= 2.0.2, < 7.0)
|
||||
mutex_m
|
||||
tzinfo (~> 2.0)
|
||||
addressable (2.8.6)
|
||||
public_suffix (>= 2.0.2, < 6.0)
|
||||
ast (2.4.2)
|
||||
base64 (0.2.0)
|
||||
bcrypt (3.1.20)
|
||||
benchmark (0.4.0)
|
||||
bigdecimal (3.1.9)
|
||||
bigdecimal (3.1.7)
|
||||
bindex (0.8.1)
|
||||
bootsnap (1.18.4)
|
||||
bootsnap (1.18.3)
|
||||
msgpack (~> 1.2)
|
||||
brakeman (7.0.0)
|
||||
racc
|
||||
builder (3.3.0)
|
||||
builder (3.2.4)
|
||||
capybara (3.40.0)
|
||||
addressable
|
||||
matrix
|
||||
|
@ -122,40 +93,34 @@ GEM
|
|||
rack-test (>= 0.6.3)
|
||||
regexp_parser (>= 1.5, < 3.0)
|
||||
xpath (~> 3.2)
|
||||
concurrent-ruby (1.3.5)
|
||||
connection_pool (2.5.0)
|
||||
concurrent-ruby (1.2.3)
|
||||
connection_pool (2.4.1)
|
||||
crass (1.0.6)
|
||||
date (3.4.1)
|
||||
debug (1.10.0)
|
||||
date (3.3.4)
|
||||
debug (1.9.2)
|
||||
irb (~> 1.10)
|
||||
reline (>= 0.3.8)
|
||||
drb (2.2.1)
|
||||
erubi (1.13.1)
|
||||
et-orbi (1.2.11)
|
||||
tzinfo
|
||||
fugit (1.11.1)
|
||||
et-orbi (~> 1, >= 1.2.11)
|
||||
raabro (~> 1.4)
|
||||
erubi (1.12.0)
|
||||
globalid (1.2.1)
|
||||
activesupport (>= 6.1)
|
||||
i18n (1.14.7)
|
||||
i18n (1.14.4)
|
||||
concurrent-ruby (~> 1.0)
|
||||
importmap-rails (2.1.0)
|
||||
importmap-rails (2.0.1)
|
||||
actionpack (>= 6.0.0)
|
||||
activesupport (>= 6.0.0)
|
||||
railties (>= 6.0.0)
|
||||
io-console (0.8.0)
|
||||
irb (1.15.1)
|
||||
pp (>= 0.6.0)
|
||||
rdoc (>= 4.0.0)
|
||||
io-console (0.7.2)
|
||||
irb (1.12.0)
|
||||
rdoc
|
||||
reline (>= 0.4.2)
|
||||
jbuilder (2.13.0)
|
||||
jbuilder (2.11.5)
|
||||
actionview (>= 5.0.0)
|
||||
activesupport (>= 5.0.0)
|
||||
json (2.10.1)
|
||||
language_server-protocol (3.17.0.4)
|
||||
logger (1.6.5)
|
||||
loofah (2.24.0)
|
||||
json (2.7.2)
|
||||
language_server-protocol (3.17.0.3)
|
||||
lint_roller (1.1.0)
|
||||
loofah (2.22.0)
|
||||
crass (~> 1.0.2)
|
||||
nokogiri (>= 1.12.0)
|
||||
mail (2.8.1)
|
||||
|
@ -166,189 +131,176 @@ GEM
|
|||
marcel (1.0.4)
|
||||
matrix (0.4.2)
|
||||
mini_mime (1.1.5)
|
||||
minitest (5.25.4)
|
||||
msgpack (1.8.0)
|
||||
net-imap (0.5.6)
|
||||
minitest (5.22.3)
|
||||
msgpack (1.7.2)
|
||||
mutex_m (0.2.0)
|
||||
net-imap (0.4.10)
|
||||
date
|
||||
net-protocol
|
||||
net-pop (0.1.2)
|
||||
net-protocol
|
||||
net-protocol (0.2.2)
|
||||
timeout
|
||||
net-smtp (0.5.1)
|
||||
net-smtp (0.5.0)
|
||||
net-protocol
|
||||
nio4r (2.7.4)
|
||||
nokogiri (1.18.2-aarch64-linux-gnu)
|
||||
nio4r (2.7.1)
|
||||
nokogiri (1.16.4-arm64-darwin)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.18.2-arm64-darwin)
|
||||
nokogiri (1.16.4-x86_64-linux)
|
||||
racc (~> 1.4)
|
||||
nokogiri (1.18.2-x86_64-linux-gnu)
|
||||
racc (~> 1.4)
|
||||
parallel (1.26.3)
|
||||
parser (3.3.7.1)
|
||||
parallel (1.24.0)
|
||||
parser (3.3.0.5)
|
||||
ast (~> 2.4.1)
|
||||
racc
|
||||
pp (0.6.2)
|
||||
prettyprint
|
||||
prettyprint (0.2.0)
|
||||
propshaft (1.1.0)
|
||||
actionpack (>= 7.0.0)
|
||||
activesupport (>= 7.0.0)
|
||||
rack
|
||||
railties (>= 7.0.0)
|
||||
psych (5.2.3)
|
||||
date
|
||||
psych (5.1.2)
|
||||
stringio
|
||||
public_suffix (6.0.1)
|
||||
puma (6.6.0)
|
||||
public_suffix (5.0.5)
|
||||
puma (6.4.2)
|
||||
nio4r (~> 2.0)
|
||||
raabro (1.4.0)
|
||||
racc (1.8.1)
|
||||
rack (3.1.9)
|
||||
rack-session (2.1.0)
|
||||
base64 (>= 0.1.0)
|
||||
racc (1.7.3)
|
||||
rack (3.0.10)
|
||||
rack-session (2.0.0)
|
||||
rack (>= 3.0.0)
|
||||
rack-test (2.2.0)
|
||||
rack-test (2.1.0)
|
||||
rack (>= 1.3)
|
||||
rackup (2.2.1)
|
||||
rackup (2.1.0)
|
||||
rack (>= 3)
|
||||
webrick (~> 1.8)
|
||||
rails (7.1.3.2)
|
||||
actioncable (= 7.1.3.2)
|
||||
actionmailbox (= 7.1.3.2)
|
||||
actionmailer (= 7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
actiontext (= 7.1.3.2)
|
||||
actionview (= 7.1.3.2)
|
||||
activejob (= 7.1.3.2)
|
||||
activemodel (= 7.1.3.2)
|
||||
activerecord (= 7.1.3.2)
|
||||
activestorage (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
bundler (>= 1.15.0)
|
||||
railties (= 7.1.3.2)
|
||||
rails-dom-testing (2.2.0)
|
||||
activesupport (>= 5.0.0)
|
||||
minitest
|
||||
nokogiri (>= 1.6)
|
||||
rails-html-sanitizer (1.6.2)
|
||||
rails-html-sanitizer (1.6.0)
|
||||
loofah (~> 2.21)
|
||||
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
|
||||
nokogiri (~> 1.14)
|
||||
railties (7.1.3.2)
|
||||
actionpack (= 7.1.3.2)
|
||||
activesupport (= 7.1.3.2)
|
||||
irb
|
||||
rackup (>= 1.0.0)
|
||||
rake (>= 12.2)
|
||||
thor (~> 1.0, >= 1.2.2)
|
||||
zeitwerk (~> 2.6)
|
||||
rainbow (3.1.1)
|
||||
rake (13.2.1)
|
||||
rdoc (6.12.0)
|
||||
rdoc (6.6.3.1)
|
||||
psych (>= 4.0.0)
|
||||
regexp_parser (2.10.0)
|
||||
reline (0.6.0)
|
||||
regexp_parser (2.9.0)
|
||||
reline (0.5.2)
|
||||
io-console (~> 0.5)
|
||||
rexml (3.4.0)
|
||||
rubocop (1.71.2)
|
||||
rexml (3.2.6)
|
||||
rubocop (1.62.1)
|
||||
json (~> 2.3)
|
||||
language_server-protocol (>= 3.17.0)
|
||||
parallel (~> 1.10)
|
||||
parser (>= 3.3.0.2)
|
||||
rainbow (>= 2.2.2, < 4.0)
|
||||
regexp_parser (>= 2.9.3, < 3.0)
|
||||
rubocop-ast (>= 1.38.0, < 2.0)
|
||||
regexp_parser (>= 1.8, < 3.0)
|
||||
rexml (>= 3.2.5, < 4.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (>= 2.4.0, < 4.0)
|
||||
rubocop-ast (1.38.0)
|
||||
parser (>= 3.3.1.0)
|
||||
rubocop-minitest (0.36.0)
|
||||
rubocop (>= 1.61, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-performance (1.23.1)
|
||||
unicode-display_width (>= 2.4.0, < 3.0)
|
||||
rubocop-ast (1.31.2)
|
||||
parser (>= 3.3.0.4)
|
||||
rubocop-performance (1.20.2)
|
||||
rubocop (>= 1.48.1, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rails (2.29.1)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 1.52.0, < 2.0)
|
||||
rubocop-ast (>= 1.31.1, < 2.0)
|
||||
rubocop-rails-omakase (1.0.0)
|
||||
rubocop
|
||||
rubocop-minitest
|
||||
rubocop-performance
|
||||
rubocop-rails
|
||||
rubocop-ast (>= 1.30.0, < 2.0)
|
||||
ruby-progressbar (1.13.0)
|
||||
rubyzip (2.4.1)
|
||||
securerandom (0.4.1)
|
||||
selenium-webdriver (4.28.0)
|
||||
base64 (~> 0.2)
|
||||
logger (~> 1.4)
|
||||
rubyzip (2.3.2)
|
||||
selenium-webdriver (4.10.0)
|
||||
rexml (~> 3.2, >= 3.2.5)
|
||||
rubyzip (>= 1.2.2, < 3.0)
|
||||
websocket (~> 1.0)
|
||||
solid_cable (3.0.7)
|
||||
actioncable (>= 7.2)
|
||||
activejob (>= 7.2)
|
||||
activerecord (>= 7.2)
|
||||
railties (>= 7.2)
|
||||
solid_cache (1.0.7)
|
||||
activejob (>= 7.2)
|
||||
activerecord (>= 7.2)
|
||||
railties (>= 7.2)
|
||||
solid_queue (1.1.3)
|
||||
activejob (>= 7.1)
|
||||
activerecord (>= 7.1)
|
||||
concurrent-ruby (>= 1.3.1)
|
||||
fugit (~> 1.11.0)
|
||||
railties (>= 7.1)
|
||||
thor (~> 1.3.1)
|
||||
sqlite3 (2.5.0-aarch64-linux-gnu)
|
||||
sqlite3 (2.5.0-arm64-darwin)
|
||||
sqlite3 (2.5.0-x86_64-linux-gnu)
|
||||
stimulus-rails (1.3.4)
|
||||
sprockets (4.2.1)
|
||||
concurrent-ruby (~> 1.0)
|
||||
rack (>= 2.2.4, < 4)
|
||||
sprockets-rails (3.4.2)
|
||||
actionpack (>= 5.2)
|
||||
activesupport (>= 5.2)
|
||||
sprockets (>= 3.0.0)
|
||||
sqlite3 (1.7.3-arm64-darwin)
|
||||
sqlite3 (1.7.3-x86_64-linux)
|
||||
standard (1.35.1)
|
||||
language_server-protocol (~> 3.17.0.2)
|
||||
lint_roller (~> 1.0)
|
||||
rubocop (~> 1.62.0)
|
||||
standard-custom (~> 1.0.0)
|
||||
standard-performance (~> 1.3)
|
||||
standard-custom (1.0.2)
|
||||
lint_roller (~> 1.0)
|
||||
rubocop (~> 1.50)
|
||||
standard-performance (1.3.1)
|
||||
lint_roller (~> 1.1)
|
||||
rubocop-performance (~> 1.20.2)
|
||||
stimulus-rails (1.3.3)
|
||||
railties (>= 6.0.0)
|
||||
stringio (3.1.2)
|
||||
tailwindcss-rails (3.3.1)
|
||||
railties (>= 7.0.0)
|
||||
tailwindcss-ruby (~> 3.0)
|
||||
tailwindcss-ruby (3.4.17-aarch64-linux)
|
||||
tailwindcss-ruby (3.4.17-arm64-darwin)
|
||||
tailwindcss-ruby (3.4.17-x86_64-linux)
|
||||
thor (1.3.2)
|
||||
timeout (0.4.3)
|
||||
turbo-rails (2.0.11)
|
||||
stringio (3.1.0)
|
||||
tailwindcss-rails (2.4.0-arm64-darwin)
|
||||
railties (>= 6.0.0)
|
||||
tailwindcss-rails (2.4.0-x86_64-linux)
|
||||
railties (>= 6.0.0)
|
||||
thor (1.3.1)
|
||||
timeout (0.4.1)
|
||||
turbo-rails (2.0.5)
|
||||
actionpack (>= 6.0.0)
|
||||
activejob (>= 6.0.0)
|
||||
railties (>= 6.0.0)
|
||||
tzinfo (2.0.6)
|
||||
concurrent-ruby (~> 1.0)
|
||||
unicode-display_width (3.1.4)
|
||||
unicode-emoji (~> 4.0, >= 4.0.4)
|
||||
unicode-emoji (4.0.4)
|
||||
uri (1.0.2)
|
||||
useragent (0.16.11)
|
||||
unicode-display_width (2.5.0)
|
||||
web-console (4.2.1)
|
||||
actionview (>= 6.0.0)
|
||||
activemodel (>= 6.0.0)
|
||||
bindex (>= 0.4.0)
|
||||
railties (>= 6.0.0)
|
||||
websocket (1.2.11)
|
||||
websocket-driver (0.7.7)
|
||||
base64
|
||||
webdrivers (5.3.1)
|
||||
nokogiri (~> 1.6)
|
||||
rubyzip (>= 1.3.0)
|
||||
selenium-webdriver (~> 4.0, < 4.11)
|
||||
webrick (1.8.1)
|
||||
websocket (1.2.10)
|
||||
websocket-driver (0.7.6)
|
||||
websocket-extensions (>= 0.1.0)
|
||||
websocket-extensions (0.1.5)
|
||||
xpath (3.2.0)
|
||||
nokogiri (~> 1.8)
|
||||
zeitwerk (2.7.1)
|
||||
zeitwerk (2.6.13)
|
||||
|
||||
PLATFORMS
|
||||
aarch64-linux
|
||||
arm64-darwin-23
|
||||
arm64-darwin-24
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
bcrypt
|
||||
bootsnap
|
||||
brakeman
|
||||
capybara
|
||||
debug
|
||||
importmap-rails
|
||||
jbuilder
|
||||
propshaft
|
||||
puma (>= 5.0)
|
||||
rails!
|
||||
rubocop-rails-omakase
|
||||
puma
|
||||
rails (= 7.1.3.2)
|
||||
selenium-webdriver
|
||||
solid_cable
|
||||
solid_cache
|
||||
solid_queue
|
||||
sqlite3 (>= 1.4)
|
||||
sprockets-rails
|
||||
sqlite3 (< 2)
|
||||
standard
|
||||
stimulus-rails
|
||||
tailwindcss-rails (~> 3.3.1)
|
||||
tailwindcss-rails (~> 2.0)
|
||||
turbo-rails
|
||||
tzinfo-data
|
||||
web-console
|
||||
|
||||
RUBY VERSION
|
||||
ruby 3.4.1p0
|
||||
webdrivers
|
||||
|
||||
BUNDLED WITH
|
||||
2.6.2
|
||||
2.5.9
|
||||
|
|
5
app/assets/config/manifest.js
Normal file
5
app/assets/config/manifest.js
Normal file
|
@ -0,0 +1,5 @@
|
|||
//= link_tree ../images
|
||||
//= link_directory ../stylesheets .css
|
||||
//= link_tree ../../javascript .js
|
||||
//= link_tree ../../../vendor/javascript .js
|
||||
//= link_tree ../builds
|
|
@ -2,12 +2,6 @@
|
|||
@tailwind components;
|
||||
@tailwind utilities;
|
||||
|
||||
.msg-notice {
|
||||
@apply bg-green-300 text-green-900;
|
||||
}
|
||||
.msg-alert {
|
||||
@apply bg-red-300 text-red-900;
|
||||
}
|
||||
/*
|
||||
|
||||
@layer components {
|
||||
|
|
|
@ -1,4 +1,2 @@
|
|||
class ApplicationController < ActionController::Base
|
||||
include Authenticatable
|
||||
include Authorizable
|
||||
end
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
module Authenticatable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :authenticate_user
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def authenticate_user
|
||||
Current.user = User.find_by(id: session[:current_user_id]) || GuestUser.new
|
||||
end
|
||||
end
|
|
@ -1,37 +0,0 @@
|
|||
module Authorizable
|
||||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
before_action :require_registered_user
|
||||
end
|
||||
|
||||
class_methods do
|
||||
def allow_unregistered_user(**args)
|
||||
skip_before_action :require_registered_user, **args
|
||||
end
|
||||
|
||||
def require_unregistered_user(**args)
|
||||
skip_before_action :require_registered_user, **args
|
||||
before_action :require_unregistered_user, **args
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def require_registered_user
|
||||
Current.user.registered? || redirect_to_sign_in
|
||||
end
|
||||
|
||||
def require_unregistered_user
|
||||
Current.user.unregistered? || redirect_to_dashboard
|
||||
end
|
||||
|
||||
def redirect_to_sign_in
|
||||
session[:return_url] = request.url
|
||||
redirect_to new_session_url, alert: "You must be logged in to continue."
|
||||
end
|
||||
|
||||
def redirect_to_dashboard
|
||||
redirect_to root_url, alert: "You are already logged in."
|
||||
end
|
||||
end
|
|
@ -3,7 +3,7 @@ class CreditCardBillsController < ApplicationController
|
|||
|
||||
# GET /credit_card_bills or /credit_card_bills.json
|
||||
def index
|
||||
@credit_card_bills = CreditCardBill.all.order(created_at: :desc)
|
||||
@credit_card_bills = CreditCardBill.all
|
||||
end
|
||||
|
||||
# GET /credit_card_bills/1 or /credit_card_bills/1.json
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
class SessionsController < ApplicationController
|
||||
require_unregistered_user only: %i[new create]
|
||||
rate_limit to: 5, within: 1.minute, only: :create, with: -> { redirect_to new_session_url, alert: "Cannot currently login" }
|
||||
# GET /sessions/new
|
||||
def new
|
||||
@session = Session.new
|
||||
end
|
||||
|
||||
# POST /sessions or /sessions.json
|
||||
def create
|
||||
@session = Session.new(session_params)
|
||||
|
||||
respond_to do |format|
|
||||
if @session.save
|
||||
session[:current_user_id] = @session.user_id
|
||||
|
||||
format.html { redirect_to redirect_url, notice: "Session was successfully created." }
|
||||
format.json { render :show, status: :created, location: @session }
|
||||
else
|
||||
format.html { render :new, status: :unprocessable_entity, alert: @session.errors }
|
||||
format.json { render json: @session.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /sessions/1 or /sessions/1.json
|
||||
def destroy
|
||||
session[:current_user_id] = nil
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to new_session_url, notice: "Session was successfully destroyed." }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def redirect_url
|
||||
session.delete(:return_url) || root_url
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def session_params
|
||||
params.require(:session).permit(:email, :password)
|
||||
end
|
||||
end
|
|
@ -1,82 +0,0 @@
|
|||
class UsersController < ApplicationController
|
||||
require_unregistered_user only: %i[new create]
|
||||
|
||||
before_action :set_user, only: %i[ show edit update destroy ]
|
||||
|
||||
# GET /users or /users.json
|
||||
def index
|
||||
@users = User.all
|
||||
end
|
||||
|
||||
# GET /users/1 or /users/1.json
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /users/new
|
||||
def new
|
||||
@user = User.new
|
||||
end
|
||||
|
||||
# GET /users/1/edit
|
||||
def edit
|
||||
end
|
||||
|
||||
# POST /users or /users.json
|
||||
def create
|
||||
@user = User.new(user_params)
|
||||
|
||||
respond_to do |format|
|
||||
if ENV["REGISTRATION_ALLOWED"].blank?
|
||||
format.html { redirect_to new_session_url, alert: "Registration disabled." }
|
||||
format.json { render json: @user.errors, status: :unprocessable_entity }
|
||||
elsif @user.save
|
||||
@session = Session.new(session_params).save
|
||||
session[:current_user_id] = @session.user_id
|
||||
|
||||
format.html { redirect_to user_url(@user), notice: "User was successfully created." }
|
||||
format.json { render :show, status: :created, location: @user }
|
||||
else
|
||||
format.html { render :new, status: :unprocessable_entity }
|
||||
format.json { render json: @user.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PATCH/PUT /users/1 or /users/1.json
|
||||
def update
|
||||
respond_to do |format|
|
||||
if @user.update(user_params)
|
||||
format.html { redirect_to user_url(@user), notice: "User was successfully updated." }
|
||||
format.json { render :show, status: :ok, location: @user }
|
||||
else
|
||||
format.html { render :edit, status: :unprocessable_entity }
|
||||
format.json { render json: @user.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /users/1 or /users/1.json
|
||||
def destroy
|
||||
@user.destroy!
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to users_url, notice: "User was successfully destroyed." }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_user
|
||||
@user = User.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def user_params
|
||||
params.require(:user).permit(:email, :password, :password_confirmation)
|
||||
end
|
||||
|
||||
def session_params
|
||||
user_params.slice(:email, :password)
|
||||
end
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
module SessionsHelper
|
||||
end
|
|
@ -1,2 +0,0 @@
|
|||
module UsersHelper
|
||||
end
|
|
@ -1,3 +0,0 @@
|
|||
class Current < ActiveSupport::CurrentAttributes
|
||||
attribute :user
|
||||
end
|
|
@ -1,5 +0,0 @@
|
|||
class GuestUser
|
||||
def registered? = false
|
||||
|
||||
def unregistered? = true
|
||||
end
|
|
@ -1,22 +0,0 @@
|
|||
class Session
|
||||
include ActiveModel::Model
|
||||
|
||||
include ActiveModel::Attributes
|
||||
include ActiveModel::Validations
|
||||
|
||||
attr_accessor :user_id
|
||||
|
||||
attribute :email, :string
|
||||
attribute :password, :string
|
||||
|
||||
validates :email, presence: true
|
||||
validates :password, presence: true
|
||||
|
||||
def save
|
||||
user = User.authenticate_by(email: email, password: password)
|
||||
|
||||
@user_id = user && user.id
|
||||
|
||||
user.present? && self || nil
|
||||
end
|
||||
end
|
|
@ -1,7 +0,0 @@
|
|||
class User < ApplicationRecord
|
||||
has_secure_password
|
||||
|
||||
def registered? = true
|
||||
|
||||
def unregistered? = false
|
||||
end
|
|
@ -14,28 +14,14 @@
|
|||
<body>
|
||||
<nav class="w-100 p-6 bg-gray-900 flex items-center justify-between flex-wrap">
|
||||
<ul class="flex">
|
||||
<% if Current.user.registered? %>
|
||||
<li class="mr-6"><%= link_to "Dashboard", root_path, class: "text-white" %></li>
|
||||
<li class="mr-6"><%= link_to "Expenses", expenses_path, class: "text-white" %></li>
|
||||
<li class="mr-6"><%= link_to "Credit Card Bills", credit_card_bills_path, class: "text-white" %></li>
|
||||
<li class="mr-6"><%= link_to "Incomes", incomes_path, class: "text-white" %></li>
|
||||
<li class="mr-6"><%= link_to "Members", members_path, class: "text-white" %></li>
|
||||
<li class="mr-6"><%= link_to "Log out", session_path, data: {turbo_method: :delete}, class: "text-white" %></li>
|
||||
<% else %>
|
||||
<li class="mr-6"><%= link_to "Sign up", new_user_path, class: "text-white" %></li>
|
||||
<li class="mr-6"><%= link_to "Log in", new_session_path, class: "text-white" %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
<% if flash.any? %>
|
||||
<% flash.each do |type, msg| %>
|
||||
<div class="py-2 px-4 font-bold msg-<%= type %>">
|
||||
<%= msg %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<main class="container mx-auto mt-28 px-5 flex">
|
||||
<%= yield %>
|
||||
</main>
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
<%= form_with(model: session, class: "contents") do |form| %>
|
||||
<% if session.errors.any? %>
|
||||
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3">
|
||||
<h2><%= pluralize(session.errors.count, "error") %> prohibited this session from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% session.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :email %>
|
||||
<%= form.text_field :email, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :password %>
|
||||
<%= form.password_field :password, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="inline">
|
||||
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,2 +0,0 @@
|
|||
<div id="<%= dom_id session %>">
|
||||
</div>
|
|
@ -1,2 +0,0 @@
|
|||
json.extract! session, :id, :created_at, :updated_at
|
||||
json.url session_url(session, format: :json)
|
|
@ -1,7 +0,0 @@
|
|||
<div class="mx-auto md:w-2/3 w-full">
|
||||
<h1 class="font-bold text-4xl">New session</h1>
|
||||
|
||||
<%= render "form", session: @session %>
|
||||
|
||||
<%= link_to "Back to sessions", sessions_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
</div>
|
|
@ -1,32 +0,0 @@
|
|||
<%= form_with(model: user, class: "contents") do |form| %>
|
||||
<% if user.errors.any? %>
|
||||
<div id="error_explanation" class="bg-red-50 text-red-500 px-3 py-2 font-medium rounded-lg mt-3">
|
||||
<h2><%= pluralize(user.errors.count, "error") %> prohibited this user from being saved:</h2>
|
||||
|
||||
<ul>
|
||||
<% user.errors.each do |error| %>
|
||||
<li><%= error.full_message %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :email %>
|
||||
<%= form.text_field :email, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :password %>
|
||||
<%= form.password_field :password, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="my-5">
|
||||
<%= form.label :password_confirmation %>
|
||||
<%= form.password_field :password_confirmation, class: "block shadow rounded-md border border-gray-400 outline-none px-3 py-2 mt-2 w-full" %>
|
||||
</div>
|
||||
|
||||
<div class="inline">
|
||||
<%= form.submit class: "rounded-lg py-3 px-5 bg-blue-600 text-white inline-block font-medium cursor-pointer" %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -1,7 +0,0 @@
|
|||
<div id="<%= dom_id user %>">
|
||||
<p class="my-5">
|
||||
<strong class="block font-medium mb-1">Email:</strong>
|
||||
<%= user.email %>
|
||||
</p>
|
||||
|
||||
</div>
|
|
@ -1,2 +0,0 @@
|
|||
json.extract! user, :id, :email, :created_at, :updated_at
|
||||
json.url user_url(user, format: :json)
|
|
@ -1,8 +0,0 @@
|
|||
<div class="mx-auto md:w-2/3 w-full">
|
||||
<h1 class="font-bold text-4xl">Editing user</h1>
|
||||
|
||||
<%= render "form", user: @user %>
|
||||
|
||||
<%= link_to "Show this user", @user, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
<%= link_to "Back to users", users_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
</div>
|
|
@ -1,21 +0,0 @@
|
|||
<div class="w-full">
|
||||
<% if notice.present? %>
|
||||
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<% content_for :title, "Users" %>
|
||||
|
||||
<div class="flex justify-between items-center">
|
||||
<h1 class="font-bold text-4xl">Users</h1>
|
||||
<%= link_to "New user", new_user_path, class: "rounded-lg py-3 px-5 bg-blue-600 text-white block font-medium" %>
|
||||
</div>
|
||||
|
||||
<div id="users" class="min-w-full">
|
||||
<% @users.each do |user| %>
|
||||
<%= render user %>
|
||||
<p>
|
||||
<%= link_to "Show this user", user, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
</p>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
|
@ -1 +0,0 @@
|
|||
json.array! @users, partial: "users/user", as: :user
|
|
@ -1,7 +0,0 @@
|
|||
<div class="mx-auto md:w-2/3 w-full">
|
||||
<h1 class="font-bold text-4xl">New user</h1>
|
||||
|
||||
<%= render "form", user: @user %>
|
||||
|
||||
<%= link_to "Back to users", users_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
</div>
|
|
@ -1,15 +0,0 @@
|
|||
<div class="mx-auto md:w-2/3 w-full flex">
|
||||
<div class="mx-auto">
|
||||
<% if notice.present? %>
|
||||
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
|
||||
<% end %>
|
||||
|
||||
<%= render @user %>
|
||||
|
||||
<%= link_to "Edit this user", edit_user_path(@user), class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
<%= link_to "Back to users", users_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
|
||||
<div class="inline-block ml-2">
|
||||
<%= button_to "Destroy this user", @user, method: :delete, class: "mt-2 rounded-lg py-3 px-5 bg-gray-100 font-medium" %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1 +0,0 @@
|
|||
json.partial! "users/user", user: @user
|
|
@ -1,7 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
ARGV.unshift("--ensure-latest")
|
||||
|
||||
load Gem.bin_path("brakeman", "brakeman")
|
10
bin/dev
10
bin/dev
|
@ -1,2 +1,8 @@
|
|||
#!/usr/bin/env ruby
|
||||
exec "./bin/rails", "server", *ARGV
|
||||
#!/usr/bin/env sh
|
||||
|
||||
if ! gem list foreman -i --silent; then
|
||||
echo "Installing foreman..."
|
||||
gem install foreman
|
||||
fi
|
||||
|
||||
exec foreman start -f Procfile.dev "$@"
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
# Enable jemalloc for reduced memory usage and latency.
|
||||
if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
|
||||
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
|
||||
fi
|
||||
|
||||
# If running the rails server then create or migrate existing database
|
||||
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
|
||||
if [ "${*}" == "./bin/rails server" ]; then
|
||||
./bin/rails db:prepare
|
||||
fi
|
||||
|
||||
|
|
6
bin/jobs
6
bin/jobs
|
@ -1,6 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
|
||||
require_relative "../config/environment"
|
||||
require "solid_queue/cli"
|
||||
|
||||
SolidQueue::Cli.start(ARGV)
|
|
@ -1,8 +0,0 @@
|
|||
#!/usr/bin/env ruby
|
||||
require "rubygems"
|
||||
require "bundler/setup"
|
||||
|
||||
# Explicit RuboCop config increases performance slightly while avoiding config confusion.
|
||||
ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__))
|
||||
|
||||
load Gem.bin_path("rubocop", "rubocop")
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env ruby
|
||||
require "fileutils"
|
||||
|
||||
# path to your application root.
|
||||
APP_ROOT = File.expand_path("..", __dir__)
|
||||
|
||||
def system!(*args)
|
||||
|
@ -13,6 +14,7 @@ FileUtils.chdir APP_ROOT do
|
|||
# Add necessary setup steps to this file.
|
||||
|
||||
puts "== Installing dependencies =="
|
||||
system! "gem install bundler --conservative"
|
||||
system("bundle check") || system!("bundle install")
|
||||
|
||||
# puts "\n== Copying sample files =="
|
||||
|
@ -26,9 +28,6 @@ FileUtils.chdir APP_ROOT do
|
|||
puts "\n== Removing old logs and tempfiles =="
|
||||
system! "bin/rails log:clear tmp:clear"
|
||||
|
||||
unless ARGV.include?("--skip-server")
|
||||
puts "\n== Starting development server =="
|
||||
STDOUT.flush # flush the output before exec(2) so that it displays
|
||||
exec "bin/dev"
|
||||
end
|
||||
puts "\n== Restarting application server =="
|
||||
system! "bin/rails restart"
|
||||
end
|
||||
|
|
|
@ -9,7 +9,7 @@ Bundler.require(*Rails.groups)
|
|||
module FamilyBudget
|
||||
class Application < Rails::Application
|
||||
# Initialize configuration defaults for originally generated Rails version.
|
||||
config.load_defaults 8.0
|
||||
config.load_defaults 7.1
|
||||
|
||||
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
||||
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
||||
|
|
|
@ -1,22 +1,10 @@
|
|||
# Async adapter only works within the same process, so for manually triggering cable updates from a console,
|
||||
# and seeing results in the browser, you must do so from the web console (running inside the dev process),
|
||||
# not a terminal started via bin/rails console! Add "console" to any action or any ERB template view
|
||||
# to make the web console appear.
|
||||
development:
|
||||
adapter: solid_cable
|
||||
connects_to:
|
||||
database:
|
||||
writing: cable
|
||||
polling_interval: 0.1.seconds
|
||||
message_retention: 1.day
|
||||
adapter: async
|
||||
|
||||
test:
|
||||
adapter: test
|
||||
|
||||
production:
|
||||
adapter: solid_cable
|
||||
connects_to:
|
||||
database:
|
||||
writing: cable
|
||||
polling_interval: 0.1.seconds
|
||||
message_retention: 1.day
|
||||
adapter: redis
|
||||
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
|
||||
channel_prefix: family_budget_production
|
||||
|
|
|
@ -10,43 +10,16 @@ default: &default
|
|||
timeout: 5000
|
||||
|
||||
development:
|
||||
primary:
|
||||
<<: *default
|
||||
database: storage/development.sqlite3
|
||||
cache:
|
||||
<<: *default
|
||||
database: storage/development_cache.sqlite3
|
||||
migrations_paths: db/cache_migrate
|
||||
queue:
|
||||
<<: *default
|
||||
database: storage/development_queue.sqlite3
|
||||
migrations_paths: db/queue_migrate
|
||||
cable:
|
||||
<<: *default
|
||||
database: storage/development_cable.sqlite3
|
||||
migrations_paths: db/cable_migrate
|
||||
|
||||
database: db/development.sqlite3
|
||||
|
||||
# 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: storage/test.sqlite3
|
||||
database: db/test.sqlite3
|
||||
|
||||
production:
|
||||
primary:
|
||||
<<: *default
|
||||
database: storage/production.sqlite3
|
||||
cache:
|
||||
<<: *default
|
||||
database: storage/production_cache.sqlite3
|
||||
migrations_paths: db/cache_migrate
|
||||
queue:
|
||||
<<: *default
|
||||
database: storage/production_queue.sqlite3
|
||||
migrations_paths: db/queue_migrate
|
||||
cable:
|
||||
<<: *default
|
||||
database: storage/production_cable.sqlite3
|
||||
migrations_paths: db/cable_migrate
|
||||
database: db/production.sqlite3
|
||||
|
|
|
@ -3,7 +3,9 @@ require "active_support/core_ext/integer/time"
|
|||
Rails.application.configure do
|
||||
# Settings specified here will take precedence over those in config/application.rb.
|
||||
|
||||
# Make code changes take effect immediately without server restart.
|
||||
# In the development environment your application's code is reloaded any time
|
||||
# it changes. This slows down response time but is perfect for development
|
||||
# since you don't have to restart the web server when you make code changes.
|
||||
config.enable_reloading = true
|
||||
|
||||
# Do not eager load code on boot.
|
||||
|
@ -12,21 +14,24 @@ Rails.application.configure do
|
|||
# Show full error reports.
|
||||
config.consider_all_requests_local = true
|
||||
|
||||
# Enable server timing.
|
||||
# Enable server timing
|
||||
config.server_timing = true
|
||||
|
||||
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
|
||||
# Run rails dev:cache to toggle Action Controller caching.
|
||||
# Enable/disable caching. By default caching is disabled.
|
||||
# Run rails dev:cache to toggle caching.
|
||||
if Rails.root.join("tmp/caching-dev.txt").exist?
|
||||
config.action_controller.perform_caching = true
|
||||
config.action_controller.enable_fragment_cache_logging = true
|
||||
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
|
||||
|
||||
config.cache_store = :memory_store
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=#{2.days.to_i}"
|
||||
}
|
||||
else
|
||||
config.action_controller.perform_caching = false
|
||||
end
|
||||
|
||||
# Change to :null_store to avoid any caching.
|
||||
config.cache_store = :solid_cache_store
|
||||
config.cache_store = :null_store
|
||||
end
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||
config.active_storage.service = :local
|
||||
|
@ -34,24 +39,23 @@ Rails.application.configure do
|
|||
# Don't care if the mailer can't send.
|
||||
config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Make template changes take effect immediately.
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Set localhost to be used by links generated in mailer templates.
|
||||
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
|
||||
|
||||
# Print deprecation notices to the Rails logger.
|
||||
config.active_support.deprecation = :log
|
||||
|
||||
# Raise exceptions for disallowed deprecations.
|
||||
config.active_support.disallowed_deprecation = :raise
|
||||
|
||||
# Tell Active Support which deprecation messages to disallow.
|
||||
config.active_support.disallowed_deprecation_warnings = []
|
||||
|
||||
# Raise an error on page load if there are pending migrations.
|
||||
config.active_record.migration_error = :page_load
|
||||
|
||||
# Highlight code that triggered database queries in logs.
|
||||
config.active_record.verbose_query_logs = true
|
||||
|
||||
# Append comments with runtime information tags to SQL queries in logs.
|
||||
config.active_record.query_log_tags_enabled = true
|
||||
|
||||
# Highlight code that enqueued background job in logs.
|
||||
config.active_job.verbose_enqueue_logs = true
|
||||
|
||||
|
@ -62,14 +66,11 @@ Rails.application.configure do
|
|||
# config.i18n.raise_on_missing_translations = true
|
||||
|
||||
# Annotate rendered view with file names.
|
||||
config.action_view.annotate_rendered_view_with_filenames = true
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||
# config.action_cable.disable_request_forgery_protection = true
|
||||
|
||||
# Raise error when a before_action's only/except options reference missing actions.
|
||||
# Raise error when a before_action's only/except options reference missing actions
|
||||
config.action_controller.raise_on_missing_callback_actions = true
|
||||
|
||||
# Apply autocorrection by RuboCop to files generated by `bin/rails generate`.
|
||||
# config.generators.apply_rubocop_autocorrect_after_generate!
|
||||
end
|
||||
|
|
|
@ -6,84 +6,92 @@ Rails.application.configure do
|
|||
# Code is not reloaded between requests.
|
||||
config.enable_reloading = false
|
||||
|
||||
# Eager load code on boot for better performance and memory savings (ignored by Rake tasks).
|
||||
# Eager load code on boot. This eager loads most of Rails and
|
||||
# your application in memory, allowing both threaded web servers
|
||||
# and those relying on copy on write to perform better.
|
||||
# Rake tasks automatically ignore this option for performance.
|
||||
config.eager_load = true
|
||||
|
||||
# Full error reports are disabled.
|
||||
# Full error reports are disabled and caching is turned on.
|
||||
config.consider_all_requests_local = false
|
||||
|
||||
# Turn on fragment caching in view templates.
|
||||
config.action_controller.perform_caching = true
|
||||
|
||||
# Cache assets for far-future expiry since they are all digest stamped.
|
||||
config.public_file_server.headers = { "cache-control" => "public, max-age=#{1.year.to_i}" }
|
||||
# Ensures that a master key has been made available in ENV["RAILS_MASTER_KEY"], config/master.key, or an environment
|
||||
# key such as config/credentials/production.key. This key is used to decrypt credentials (and other encrypted files).
|
||||
# config.require_master_key = true
|
||||
|
||||
# Enable static file serving from the `/public` folder (turn off if using NGINX/Apache for it).
|
||||
config.public_file_server.enabled = true
|
||||
|
||||
# Compress CSS using a preprocessor.
|
||||
# config.assets.css_compressor = :sass
|
||||
|
||||
# Do not fallback to assets pipeline if a precompiled asset is missed.
|
||||
config.assets.compile = false
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
|
||||
# config.asset_host = "http://assets.example.com"
|
||||
|
||||
# Specifies the header that your server uses for sending files.
|
||||
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for Apache
|
||||
# config.action_dispatch.x_sendfile_header = "X-Accel-Redirect" # for NGINX
|
||||
|
||||
# Store uploaded files on the local file system (see config/storage.yml for options).
|
||||
config.active_storage.service = :local
|
||||
|
||||
# Mount Action Cable outside main process or domain.
|
||||
# config.action_cable.mount_path = nil
|
||||
# config.action_cable.url = "wss://example.com/cable"
|
||||
# config.action_cable.allowed_request_origins = [ "http://example.com", /http:\/\/example.*/ ]
|
||||
|
||||
# Assume all access to the app is happening through a SSL-terminating reverse proxy.
|
||||
# Can be used together with config.force_ssl for Strict-Transport-Security and secure cookies.
|
||||
# config.assume_ssl = true
|
||||
|
||||
# Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
|
||||
config.force_ssl = false
|
||||
|
||||
# Skip http-to-https redirect for the default health check endpoint.
|
||||
# config.ssl_options = { redirect: { exclude: ->(request) { request.path == "/up" } } }
|
||||
# Log to STDOUT by default
|
||||
config.logger = ActiveSupport::Logger.new($stdout)
|
||||
.tap { |logger| logger.formatter = ::Logger::Formatter.new }
|
||||
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
||||
|
||||
# Log to STDOUT with the current request id as a default log tag.
|
||||
# Prepend all log lines with the following tags.
|
||||
config.log_tags = [:request_id]
|
||||
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
|
||||
|
||||
# Change to "debug" to log everything (including potentially personally-identifiable information!).
|
||||
# Info include generic and useful information about system operation, but avoids logging too much
|
||||
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
||||
# want to log everything, set the level to "debug".
|
||||
config.log_level = ENV.fetch("RAILS_LOG_LEVEL", "info")
|
||||
|
||||
# Prevent health checks from clogging up the logs.
|
||||
config.silence_healthcheck_path = "/up"
|
||||
|
||||
# Don't log any deprecations.
|
||||
config.active_support.report_deprecations = false
|
||||
|
||||
# Replace the default in-process memory cache store with a durable alternative.
|
||||
# Use a different cache store in production.
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
# Replace the default in-process and non-durable queuing backend for Active Job.
|
||||
config.cache_store = :solid_cache_store
|
||||
# Use a real queuing backend for Active Job (and separate queues per environment).
|
||||
# config.active_job.queue_adapter = :resque
|
||||
# config.active_job.queue_name_prefix = "family_budget_production"
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Ignore bad email addresses and do not raise email delivery errors.
|
||||
# Set this to true and configure the email server for immediate delivery to raise delivery errors.
|
||||
# config.action_mailer.raise_delivery_errors = false
|
||||
|
||||
# Set host to be used by links generated in mailer templates.
|
||||
config.action_mailer.default_url_options = { host: "example.com" }
|
||||
|
||||
# Specify outgoing SMTP server. Remember to add smtp/* credentials via rails credentials:edit.
|
||||
# config.action_mailer.smtp_settings = {
|
||||
# user_name: Rails.application.credentials.dig(:smtp, :user_name),
|
||||
# password: Rails.application.credentials.dig(:smtp, :password),
|
||||
# address: "smtp.example.com",
|
||||
# port: 587,
|
||||
# authentication: :plain
|
||||
# }
|
||||
|
||||
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||
# the I18n.default_locale when a translation cannot be found).
|
||||
config.i18n.fallbacks = true
|
||||
|
||||
# Don't log any deprecations.
|
||||
config.active_support.report_deprecations = false
|
||||
|
||||
# Do not dump schema after migrations.
|
||||
config.active_record.dump_schema_after_migration = false
|
||||
|
||||
# Only use :id for inspections in production.
|
||||
config.active_record.attributes_for_inspect = [ :id ]
|
||||
|
||||
# Enable DNS rebinding protection and other `Host` header attacks.
|
||||
# config.hosts = [
|
||||
# "example.com", # Allow requests from example.com
|
||||
# /.*\.example\.com/ # Allow requests from subdomains like `www.example.com`
|
||||
# ]
|
||||
#
|
||||
# Skip DNS rebinding protection for the default health check endpoint.
|
||||
# config.host_authorization = { exclude: ->(request) { request.path == "/up" } }
|
||||
end
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
require "active_support/core_ext/integer/time"
|
||||
|
||||
# The test environment is used exclusively to run your application's
|
||||
# test suite. You never need to work with it otherwise. Remember that
|
||||
# your test database is "scratch space" for the test suite and is wiped
|
||||
|
@ -15,14 +17,18 @@ Rails.application.configure do
|
|||
# loading is working properly before deploying your code.
|
||||
config.eager_load = ENV["CI"].present?
|
||||
|
||||
# Configure public file server for tests with cache-control for performance.
|
||||
config.public_file_server.headers = { "cache-control" => "public, max-age=3600" }
|
||||
# Configure public file server for tests with Cache-Control for performance.
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
||||
}
|
||||
|
||||
# Show full error reports.
|
||||
# Show full error reports and disable caching.
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
config.cache_store = :null_store
|
||||
|
||||
# Render exception templates for rescuable exceptions and raise for other exceptions.
|
||||
# Raise exceptions instead of rendering exception templates.
|
||||
config.action_dispatch.show_exceptions = :rescuable
|
||||
|
||||
# Disable request forgery protection in test environment.
|
||||
|
@ -31,23 +37,28 @@ Rails.application.configure do
|
|||
# Store uploaded files on the local file system in a temporary directory.
|
||||
config.active_storage.service = :test
|
||||
|
||||
config.action_mailer.perform_caching = false
|
||||
|
||||
# Tell Action Mailer not to deliver emails to the real world.
|
||||
# The :test delivery method accumulates sent emails in the
|
||||
# ActionMailer::Base.deliveries array.
|
||||
config.action_mailer.delivery_method = :test
|
||||
|
||||
# Set host to be used by links generated in mailer templates.
|
||||
config.action_mailer.default_url_options = { host: "example.com" }
|
||||
|
||||
# Print deprecation notices to the stderr.
|
||||
config.active_support.deprecation = :stderr
|
||||
|
||||
# Raise exceptions for disallowed deprecations.
|
||||
config.active_support.disallowed_deprecation = :raise
|
||||
|
||||
# Tell Active Support which deprecation messages to disallow.
|
||||
config.active_support.disallowed_deprecation_warnings = []
|
||||
|
||||
# Raises error for missing translations.
|
||||
# config.i18n.raise_on_missing_translations = true
|
||||
|
||||
# Annotate rendered view with file names.
|
||||
# config.action_view.annotate_rendered_view_with_filenames = true
|
||||
|
||||
# Raise error when a before_action's only/except options reference missing actions.
|
||||
# Raise error when a before_action's only/except options reference missing actions
|
||||
config.action_controller.raise_on_missing_callback_actions = true
|
||||
end
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
# Use a real queuing backend for Active Job (and separate queues per environment).
|
||||
Rails.application.config.active_job.queue_adapter = :solid_queue
|
||||
Rails.application.config.solid_queue.connects_to = { database: { writing: :queue } }
|
|
@ -5,3 +5,8 @@ Rails.application.config.assets.version = "1.0"
|
|||
|
||||
# Add additional assets to the asset load path.
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
|
||||
# Precompile additional assets.
|
||||
# application.js, application.css, and all non-JS/CSS in the app/assets
|
||||
# folder are already added.
|
||||
# Rails.application.config.assets.precompile += %w( admin.js admin.css )
|
||||
|
|
|
@ -4,5 +4,5 @@
|
|||
# Use this to limit dissemination of sensitive information.
|
||||
# See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors.
|
||||
Rails.application.config.filter_parameters += [
|
||||
:passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn, :cvv, :cvc
|
||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||
]
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
# Be sure to restart your server when you modify this file.
|
||||
#
|
||||
# This file eases your Rails 8.1 framework defaults upgrade.
|
||||
#
|
||||
# Uncomment each configuration one by one to switch to the new default.
|
||||
# Once your application is ready to run with all new defaults, you can remove
|
||||
# this file and set the `config.load_defaults` to `8.1`.
|
||||
#
|
||||
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
|
@ -1,12 +0,0 @@
|
|||
# Automatically enable YJIT if running Ruby 3.3 or newer,
|
||||
# as it brings very sizeable performance improvements.
|
||||
# Many users reported 15-25% improved latency.
|
||||
|
||||
# If you are deploying to a memory-constrained environment,
|
||||
# you may want to delete this file, but otherwise, it's free
|
||||
# performance.
|
||||
if defined? RubyVM::YJIT.enable
|
||||
Rails.application.config.after_initialize do
|
||||
RubyVM::YJIT.enable
|
||||
end
|
||||
end
|
|
@ -1,44 +1,43 @@
|
|||
# This configuration file will be evaluated by Puma. The top-level methods that
|
||||
# are invoked here are part of Puma's configuration DSL. For more information
|
||||
# about methods provided by the DSL, see https://puma.io/puma/Puma/DSL.html.
|
||||
# Puma can serve each request in a thread from an internal thread pool.
|
||||
# The `threads` method setting takes two numbers: a minimum and maximum.
|
||||
# Any libraries that use thread pools should be configured to match
|
||||
# the maximum value specified for Puma. Default is set to 5 threads for minimum
|
||||
# and maximum; this matches the default thread size of Active Record.
|
||||
#
|
||||
# Puma starts a configurable number of processes (workers) and each process
|
||||
# serves each request in a thread from an internal thread pool.
|
||||
max_threads_count = ENV.fetch("RAILS_MAX_THREADS", 5)
|
||||
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
|
||||
threads min_threads_count, max_threads_count
|
||||
|
||||
# Specifies the `worker_timeout` threshold that Puma will use to wait before
|
||||
# terminating a worker in development environments.
|
||||
#
|
||||
# You can control the number of workers using ENV["WEB_CONCURRENCY"]. You
|
||||
# should only set this value when you want to run 2 or more workers. The
|
||||
# default is already 1. You can set it to `auto` to automatically start a worker
|
||||
# for each available processor.
|
||||
#
|
||||
# The ideal number of threads per worker depends both on how much time the
|
||||
# application spends waiting for IO operations and on how much you wish to
|
||||
# prioritize throughput over latency.
|
||||
#
|
||||
# As a rule of thumb, increasing the number of threads will increase how much
|
||||
# traffic a given process can handle (throughput), but due to CRuby's
|
||||
# Global VM Lock (GVL) it has diminishing returns and will degrade the
|
||||
# response time (latency) of the application.
|
||||
#
|
||||
# The default is set to 3 threads as it's deemed a decent compromise between
|
||||
# throughput and latency for the average Rails application.
|
||||
#
|
||||
# Any libraries that use a connection pool or another resource pool should
|
||||
# be configured to provide at least as many connections as the number of
|
||||
# threads. This includes Active Record's `pool` parameter in `database.yml`.
|
||||
threads_count = ENV.fetch("RAILS_MAX_THREADS", 3)
|
||||
threads threads_count, threads_count
|
||||
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
|
||||
|
||||
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
|
||||
#
|
||||
port ENV.fetch("PORT", 3000)
|
||||
|
||||
# Specifies the `environment` that Puma will run in.
|
||||
#
|
||||
environment ENV.fetch("RAILS_ENV") { "development" }
|
||||
|
||||
# Specifies the `pidfile` that Puma will use.
|
||||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
|
||||
|
||||
# Specifies the number of `workers` to boot in clustered mode.
|
||||
# Workers are forked web server processes. If using threads and workers together
|
||||
# the concurrency of the application would be max `threads` * `workers`.
|
||||
# Workers do not work on JRuby or Windows (both of which do not support
|
||||
# processes).
|
||||
#
|
||||
# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
|
||||
|
||||
# Use the `preload_app!` method when specifying a `workers` number.
|
||||
# This directive tells Puma to first boot the application and load code
|
||||
# before forking the application. This takes advantage of Copy On Write
|
||||
# process behavior so workers use less memory.
|
||||
#
|
||||
# preload_app!
|
||||
|
||||
# Allow puma to be restarted by `bin/rails restart` command.
|
||||
plugin :tmp_restart
|
||||
|
||||
# Run the Solid Queue supervisor inside of Puma for single-server deployments.
|
||||
plugin :solid_queue if ENV["SOLID_QUEUE_IN_PUMA"]
|
||||
|
||||
# Specify the PID file. Defaults to tmp/pids/server.pid in development.
|
||||
# In other environments, only set the PID file if requested.
|
||||
pidfile ENV["PIDFILE"] if ENV["PIDFILE"]
|
||||
|
||||
plugin :tailwindcss if ENV.fetch("RAILS_ENV", "development") == "development"
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
default: &default
|
||||
dispatchers:
|
||||
- polling_interval: 1
|
||||
batch_size: 500
|
||||
workers:
|
||||
- queues: "*"
|
||||
threads: 3
|
||||
processes: <%= ENV.fetch("JOB_CONCURRENCY", 1) %>
|
||||
polling_interval: 0.1
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
|
||||
production:
|
||||
<<: *default
|
|
@ -1,10 +0,0 @@
|
|||
# production:
|
||||
# periodic_cleanup:
|
||||
# class: CleanSoftDeletedRecordsJob
|
||||
# queue: background
|
||||
# args: [ 1000, { batch_size: 500 } ]
|
||||
# schedule: every hour
|
||||
# periodic_command:
|
||||
# command: "SoftDeletedRecord.due.delete_all"
|
||||
# priority: 2
|
||||
# schedule: at 5am every day
|
|
@ -1,7 +1,4 @@
|
|||
Rails.application.routes.draw do
|
||||
resources :sessions, only: %i[new create]
|
||||
resource :session, only: :destroy
|
||||
resources :users
|
||||
resources :credit_card_bills
|
||||
resource :dashboard, only: :show
|
||||
resources :incomes
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
default: &default
|
||||
database: cache
|
||||
store_options:
|
||||
# Cap age of oldest cache entry to fulfill retention policies
|
||||
# max_age: <%= 60.days.to_i %>
|
||||
max_size: <%= 256.megabytes %>
|
||||
namespace: <%= Rails.env %>
|
||||
|
||||
development:
|
||||
<<: *default
|
||||
|
||||
test:
|
||||
<<: *default
|
||||
|
||||
production:
|
||||
<<: *default
|
|
@ -1,23 +0,0 @@
|
|||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 1) do
|
||||
create_table "solid_cable_messages", force: :cascade do |t|
|
||||
t.binary "channel", limit: 1024, null: false
|
||||
t.integer "channel_hash", limit: 8, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.binary "payload", limit: 536870912, null: false
|
||||
t.index ["channel"], name: "index_solid_cable_messages_on_channel"
|
||||
t.index ["channel_hash"], name: "index_solid_cable_messages_on_channel_hash"
|
||||
t.index ["created_at"], name: "index_solid_cable_messages_on_created_at"
|
||||
end
|
||||
end
|
|
@ -1,24 +0,0 @@
|
|||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 1) do
|
||||
create_table "solid_cache_entries", force: :cascade do |t|
|
||||
t.integer "byte_size", limit: 4, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.binary "key", limit: 1024, null: false
|
||||
t.integer "key_hash", limit: 8, null: false
|
||||
t.binary "value", limit: 536870912, null: false
|
||||
t.index ["byte_size"], name: "index_solid_cache_entries_on_byte_size"
|
||||
t.index ["key_hash", "byte_size"], name: "index_solid_cache_entries_on_key_hash_and_byte_size"
|
||||
t.index ["key_hash"], name: "index_solid_cache_entries_on_key_hash", unique: true
|
||||
end
|
||||
end
|
|
@ -1,101 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20231211200639)
|
||||
class CreateSolidQueueTables < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :solid_queue_jobs do |t|
|
||||
t.string :queue_name, null: false
|
||||
t.string :class_name, null: false, index: true
|
||||
t.text :arguments
|
||||
t.integer :priority, default: 0, null: false
|
||||
t.string :active_job_id, index: true
|
||||
t.datetime :scheduled_at
|
||||
t.datetime :finished_at, index: true
|
||||
t.string :concurrency_key
|
||||
|
||||
t.timestamps
|
||||
|
||||
t.index [ :queue_name, :finished_at ], name: "index_solid_queue_jobs_for_filtering"
|
||||
t.index [ :scheduled_at, :finished_at ], name: "index_solid_queue_jobs_for_alerting"
|
||||
end
|
||||
|
||||
create_table :solid_queue_scheduled_executions do |t|
|
||||
t.references :job, index: { unique: true }, null: false
|
||||
t.string :queue_name, null: false
|
||||
t.integer :priority, default: 0, null: false
|
||||
t.datetime :scheduled_at, null: false
|
||||
|
||||
t.datetime :created_at, null: false
|
||||
|
||||
t.index [ :scheduled_at, :priority, :job_id ], name: "index_solid_queue_dispatch_all"
|
||||
end
|
||||
|
||||
create_table :solid_queue_ready_executions do |t|
|
||||
t.references :job, index: { unique: true }, null: false
|
||||
t.string :queue_name, null: false
|
||||
t.integer :priority, default: 0, null: false
|
||||
|
||||
t.datetime :created_at, null: false
|
||||
|
||||
t.index [ :priority, :job_id ], name: "index_solid_queue_poll_all"
|
||||
t.index [ :queue_name, :priority, :job_id ], name: "index_solid_queue_poll_by_queue"
|
||||
end
|
||||
|
||||
create_table :solid_queue_claimed_executions do |t|
|
||||
t.references :job, index: { unique: true }, null: false
|
||||
t.bigint :process_id
|
||||
t.datetime :created_at, null: false
|
||||
|
||||
t.index [ :process_id, :job_id ]
|
||||
end
|
||||
|
||||
create_table :solid_queue_blocked_executions do |t|
|
||||
t.references :job, index: { unique: true }, null: false
|
||||
t.string :queue_name, null: false
|
||||
t.integer :priority, default: 0, null: false
|
||||
t.string :concurrency_key, null: false
|
||||
t.datetime :expires_at, null: false
|
||||
|
||||
t.datetime :created_at, null: false
|
||||
|
||||
t.index [ :expires_at, :concurrency_key ], name: "index_solid_queue_blocked_executions_for_maintenance"
|
||||
end
|
||||
|
||||
create_table :solid_queue_failed_executions do |t|
|
||||
t.references :job, index: { unique: true }, null: false
|
||||
t.text :error
|
||||
t.datetime :created_at, null: false
|
||||
end
|
||||
|
||||
create_table :solid_queue_pauses do |t|
|
||||
t.string :queue_name, null: false, index: { unique: true }
|
||||
t.datetime :created_at, null: false
|
||||
end
|
||||
|
||||
create_table :solid_queue_processes do |t|
|
||||
t.string :kind, null: false
|
||||
t.datetime :last_heartbeat_at, null: false, index: true
|
||||
t.bigint :supervisor_id, index: true
|
||||
|
||||
t.integer :pid, null: false
|
||||
t.string :hostname
|
||||
t.text :metadata
|
||||
|
||||
t.datetime :created_at, null: false
|
||||
end
|
||||
|
||||
create_table :solid_queue_semaphores do |t|
|
||||
t.string :key, null: false, index: { unique: true }
|
||||
t.integer :value, default: 1, null: false
|
||||
t.datetime :expires_at, null: false, index: true
|
||||
|
||||
t.timestamps
|
||||
|
||||
t.index [ :key, :value ], name: "index_solid_queue_semaphores_on_key_and_value"
|
||||
end
|
||||
|
||||
add_foreign_key :solid_queue_blocked_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade
|
||||
add_foreign_key :solid_queue_claimed_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade
|
||||
add_foreign_key :solid_queue_failed_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade
|
||||
add_foreign_key :solid_queue_ready_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade
|
||||
add_foreign_key :solid_queue_scheduled_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20240110143450)
|
||||
class AddMissingIndexToBlockedExecutions < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_index :solid_queue_blocked_executions, [ :concurrency_key, :priority, :job_id ], name: "index_solid_queue_blocked_executions_for_release"
|
||||
end
|
||||
end
|
|
@ -1,15 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20240218110712)
|
||||
class CreateRecurringExecutions < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :solid_queue_recurring_executions do |t|
|
||||
t.references :job, index: { unique: true }, null: false
|
||||
t.string :task_key, null: false
|
||||
t.datetime :run_at, null: false
|
||||
t.datetime :created_at, null: false
|
||||
|
||||
t.index [ :task_key, :run_at ], unique: true
|
||||
end
|
||||
|
||||
add_foreign_key :solid_queue_recurring_executions, :solid_queue_jobs, column: :job_id, on_delete: :cascade
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
class CreateUsers < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :users do |t|
|
||||
t.string :email
|
||||
t.string :password_digest
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
add_index :users, :email, unique: true
|
||||
end
|
||||
end
|
|
@ -1,21 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20240719134516)
|
||||
class CreateRecurringTasks < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :solid_queue_recurring_tasks do |t|
|
||||
t.string :key, null: false, index: { unique: true }
|
||||
t.string :schedule, null: false
|
||||
t.string :command, limit: 2048
|
||||
t.string :class_name
|
||||
t.text :arguments
|
||||
|
||||
t.string :queue_name
|
||||
t.integer :priority, default: 0
|
||||
|
||||
t.boolean :static, default: true, index: true
|
||||
|
||||
t.text :description
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20240811173327)
|
||||
class AddNameToProcesses < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
add_column :solid_queue_processes, :name, :string
|
||||
end
|
||||
end
|
|
@ -1,17 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20240813160053)
|
||||
class MakeNameNotNull < ActiveRecord::Migration[7.1]
|
||||
def up
|
||||
SolidQueue::Process.where(name: nil).find_each do |process|
|
||||
process.name ||= [ process.kind.downcase, SecureRandom.hex(10) ].join("-")
|
||||
process.save!
|
||||
end
|
||||
|
||||
change_column :solid_queue_processes, :name, :string, null: false
|
||||
add_index :solid_queue_processes, [ :name, :supervisor_id ], unique: true
|
||||
end
|
||||
|
||||
def down
|
||||
remove_index :solid_queue_processes, [ :name, :supervisor_id ]
|
||||
change_column :solid_queue_processes, :name, :string, null: false
|
||||
end
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
# This migration comes from solid_queue (originally 20240819165045)
|
||||
class ChangeSolidQueueRecurringTasksStaticToNotNull < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
change_column_null :solid_queue_recurring_tasks, :static, false, true
|
||||
end
|
||||
end
|
|
@ -1,141 +0,0 @@
|
|||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# This file is the source Rails uses to define your schema when running `bin/rails
|
||||
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
|
||||
# be faster and is potentially less error prone than running all of your
|
||||
# migrations from scratch. Old migrations may fail to apply correctly if those
|
||||
# migrations use external dependencies or application code.
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2024_09_04_193154) do
|
||||
create_table "solid_queue_blocked_executions", force: :cascade do |t|
|
||||
t.string "concurrency_key", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "expires_at", null: false
|
||||
t.bigint "job_id", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.index ["concurrency_key", "priority", "job_id"], name: "index_solid_queue_blocked_executions_for_release"
|
||||
t.index ["expires_at", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_maintenance"
|
||||
t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_claimed_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.bigint "job_id", null: false
|
||||
t.bigint "process_id"
|
||||
t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true
|
||||
t.index ["process_id", "job_id"], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id"
|
||||
end
|
||||
|
||||
create_table "solid_queue_failed_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.text "error"
|
||||
t.bigint "job_id", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_jobs", force: :cascade do |t|
|
||||
t.string "active_job_id"
|
||||
t.text "arguments"
|
||||
t.string "class_name", null: false
|
||||
t.string "concurrency_key"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "finished_at"
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.datetime "scheduled_at"
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["active_job_id"], name: "index_solid_queue_jobs_on_active_job_id"
|
||||
t.index ["class_name"], name: "index_solid_queue_jobs_on_class_name"
|
||||
t.index ["finished_at"], name: "index_solid_queue_jobs_on_finished_at"
|
||||
t.index ["queue_name", "finished_at"], name: "index_solid_queue_jobs_for_filtering"
|
||||
t.index ["scheduled_at", "finished_at"], name: "index_solid_queue_jobs_for_alerting"
|
||||
end
|
||||
|
||||
create_table "solid_queue_pauses", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "queue_name", null: false
|
||||
t.index ["queue_name"], name: "index_solid_queue_pauses_on_queue_name", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_processes", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "hostname"
|
||||
t.string "kind", null: false
|
||||
t.datetime "last_heartbeat_at", null: false
|
||||
t.text "metadata"
|
||||
t.string "name", null: false
|
||||
t.integer "pid", null: false
|
||||
t.bigint "supervisor_id"
|
||||
t.index ["last_heartbeat_at"], name: "index_solid_queue_processes_on_last_heartbeat_at"
|
||||
t.index ["name", "supervisor_id"], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true
|
||||
t.index ["supervisor_id"], name: "index_solid_queue_processes_on_supervisor_id"
|
||||
end
|
||||
|
||||
create_table "solid_queue_ready_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.bigint "job_id", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true
|
||||
t.index ["priority", "job_id"], name: "index_solid_queue_poll_all"
|
||||
t.index ["queue_name", "priority", "job_id"], name: "index_solid_queue_poll_by_queue"
|
||||
end
|
||||
|
||||
create_table "solid_queue_recurring_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.bigint "job_id", null: false
|
||||
t.datetime "run_at", null: false
|
||||
t.string "task_key", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_recurring_executions_on_job_id", unique: true
|
||||
t.index ["task_key", "run_at"], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_recurring_tasks", force: :cascade do |t|
|
||||
t.text "arguments"
|
||||
t.string "class_name"
|
||||
t.string "command", limit: 2048
|
||||
t.datetime "created_at", null: false
|
||||
t.text "description"
|
||||
t.string "key", null: false
|
||||
t.integer "priority", default: 0
|
||||
t.string "queue_name"
|
||||
t.string "schedule", null: false
|
||||
t.boolean "static", default: true, null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["key"], name: "index_solid_queue_recurring_tasks_on_key", unique: true
|
||||
t.index ["static"], name: "index_solid_queue_recurring_tasks_on_static"
|
||||
end
|
||||
|
||||
create_table "solid_queue_scheduled_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.bigint "job_id", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.datetime "scheduled_at", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true
|
||||
t.index ["scheduled_at", "priority", "job_id"], name: "index_solid_queue_dispatch_all"
|
||||
end
|
||||
|
||||
create_table "solid_queue_semaphores", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "expires_at", null: false
|
||||
t.string "key", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "value", default: 1, null: false
|
||||
t.index ["expires_at"], name: "index_solid_queue_semaphores_on_expires_at"
|
||||
t.index ["key", "value"], name: "index_solid_queue_semaphores_on_key_and_value"
|
||||
t.index ["key"], name: "index_solid_queue_semaphores_on_key", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
end
|
151
db/schema.rb
generated
151
db/schema.rb
generated
|
@ -10,175 +10,40 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.1].define(version: 2024_09_09_011044) do
|
||||
ActiveRecord::Schema[7.1].define(version: 2023_10_11_024748) do
|
||||
create_table "credit_card_bills", force: :cascade do |t|
|
||||
t.string "description"
|
||||
t.decimal "amount"
|
||||
t.datetime "created_at", null: false
|
||||
t.string "description"
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "expenses", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.boolean "credit_card", default: false, null: false
|
||||
t.string "description", default: "", null: false
|
||||
t.boolean "estimated", default: false, null: false
|
||||
t.decimal "payment", precision: 8, scale: 2, default: "0.0", null: false
|
||||
t.integer "period", default: 0, null: false
|
||||
t.boolean "credit_card", default: false, null: false
|
||||
t.boolean "estimated", default: false, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "incomes", force: :cascade do |t|
|
||||
t.decimal "amount", precision: 9, scale: 2, default: "0.0", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.string "description", default: "", null: false
|
||||
t.boolean "included", default: true, null: false
|
||||
t.decimal "amount", precision: 9, scale: 2, default: "0.0", null: false
|
||||
t.integer "member_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["member_id"], name: "index_incomes_on_member_id"
|
||||
end
|
||||
|
||||
create_table "members", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "name", default: "", null: false
|
||||
t.boolean "pays", default: true, null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "solid_queue_blocked_executions", force: :cascade do |t|
|
||||
t.string "concurrency_key", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "expires_at", null: false
|
||||
t.integer "job_id", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.index ["concurrency_key", "priority", "job_id"], name: "index_solid_queue_blocked_executions_for_release"
|
||||
t.index ["expires_at", "concurrency_key"], name: "index_solid_queue_blocked_executions_for_maintenance"
|
||||
t.index ["job_id"], name: "index_solid_queue_blocked_executions_on_job_id", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_claimed_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "job_id", null: false
|
||||
t.bigint "process_id"
|
||||
t.index ["job_id"], name: "index_solid_queue_claimed_executions_on_job_id", unique: true
|
||||
t.index ["process_id", "job_id"], name: "index_solid_queue_claimed_executions_on_process_id_and_job_id"
|
||||
end
|
||||
|
||||
create_table "solid_queue_failed_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.text "error"
|
||||
t.integer "job_id", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_failed_executions_on_job_id", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_jobs", force: :cascade do |t|
|
||||
t.string "active_job_id"
|
||||
t.text "arguments"
|
||||
t.string "class_name", null: false
|
||||
t.string "concurrency_key"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "finished_at"
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.datetime "scheduled_at"
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["active_job_id"], name: "index_solid_queue_jobs_on_active_job_id"
|
||||
t.index ["class_name"], name: "index_solid_queue_jobs_on_class_name"
|
||||
t.index ["finished_at"], name: "index_solid_queue_jobs_on_finished_at"
|
||||
t.index ["queue_name", "finished_at"], name: "index_solid_queue_jobs_for_filtering"
|
||||
t.index ["scheduled_at", "finished_at"], name: "index_solid_queue_jobs_for_alerting"
|
||||
end
|
||||
|
||||
create_table "solid_queue_pauses", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "queue_name", null: false
|
||||
t.index ["queue_name"], name: "index_solid_queue_pauses_on_queue_name", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_processes", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "hostname"
|
||||
t.string "kind", null: false
|
||||
t.datetime "last_heartbeat_at", null: false
|
||||
t.text "metadata"
|
||||
t.string "name", null: false
|
||||
t.integer "pid", null: false
|
||||
t.bigint "supervisor_id"
|
||||
t.index ["last_heartbeat_at"], name: "index_solid_queue_processes_on_last_heartbeat_at"
|
||||
t.index ["name", "supervisor_id"], name: "index_solid_queue_processes_on_name_and_supervisor_id", unique: true
|
||||
t.index ["supervisor_id"], name: "index_solid_queue_processes_on_supervisor_id"
|
||||
end
|
||||
|
||||
create_table "solid_queue_ready_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "job_id", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_ready_executions_on_job_id", unique: true
|
||||
t.index ["priority", "job_id"], name: "index_solid_queue_poll_all"
|
||||
t.index ["queue_name", "priority", "job_id"], name: "index_solid_queue_poll_by_queue"
|
||||
end
|
||||
|
||||
create_table "solid_queue_recurring_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "job_id", null: false
|
||||
t.datetime "run_at", null: false
|
||||
t.string "task_key", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_recurring_executions_on_job_id", unique: true
|
||||
t.index ["task_key", "run_at"], name: "index_solid_queue_recurring_executions_on_task_key_and_run_at", unique: true
|
||||
end
|
||||
|
||||
create_table "solid_queue_recurring_tasks", force: :cascade do |t|
|
||||
t.text "arguments"
|
||||
t.string "class_name"
|
||||
t.string "command", limit: 2048
|
||||
t.datetime "created_at", null: false
|
||||
t.text "description"
|
||||
t.string "key", null: false
|
||||
t.integer "priority", default: 0
|
||||
t.string "queue_name"
|
||||
t.string "schedule", null: false
|
||||
t.boolean "static", default: true, null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["key"], name: "index_solid_queue_recurring_tasks_on_key", unique: true
|
||||
t.index ["static"], name: "index_solid_queue_recurring_tasks_on_static"
|
||||
end
|
||||
|
||||
create_table "solid_queue_scheduled_executions", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.integer "job_id", null: false
|
||||
t.integer "priority", default: 0, null: false
|
||||
t.string "queue_name", null: false
|
||||
t.datetime "scheduled_at", null: false
|
||||
t.index ["job_id"], name: "index_solid_queue_scheduled_executions_on_job_id", unique: true
|
||||
t.index ["scheduled_at", "priority", "job_id"], name: "index_solid_queue_dispatch_all"
|
||||
end
|
||||
|
||||
create_table "solid_queue_semaphores", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "expires_at", null: false
|
||||
t.string "key", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "value", default: 1, null: false
|
||||
t.index ["expires_at"], name: "index_solid_queue_semaphores_on_expires_at"
|
||||
t.index ["key", "value"], name: "index_solid_queue_semaphores_on_key_and_value"
|
||||
t.index ["key"], name: "index_solid_queue_semaphores_on_key", unique: true
|
||||
end
|
||||
|
||||
create_table "users", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.string "email"
|
||||
t.string "password_digest"
|
||||
t.datetime "updated_at", null: false
|
||||
t.index ["email"], name: "index_users_on_email", unique: true
|
||||
end
|
||||
|
||||
add_foreign_key "incomes", "members"
|
||||
add_foreign_key "solid_queue_blocked_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_claimed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_failed_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_ready_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_recurring_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
add_foreign_key "solid_queue_scheduled_executions", "solid_queue_jobs", column: "job_id", on_delete: :cascade
|
||||
end
|
||||
|
|
114
public/400.html
114
public/400.html
|
@ -1,114 +0,0 @@
|
|||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<title>The server cannot process the request due to a client error (400 Bad Request)</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1, width=device-width">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
<style>
|
||||
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #FFF;
|
||||
color: #261B23;
|
||||
display: grid;
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-size: clamp(1rem, 2.5vw, 2rem);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
letter-spacing: -0.0025em;
|
||||
line-height: 1.4;
|
||||
min-height: 100vh;
|
||||
place-items: center;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.0925em;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
i, em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
main {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
padding: 2em;
|
||||
place-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main header {
|
||||
width: min(100%, 12em);
|
||||
}
|
||||
|
||||
main header svg {
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
main article {
|
||||
width: min(100%, 30em);
|
||||
}
|
||||
|
||||
main article p {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
main article br {
|
||||
|
||||
display: none;
|
||||
|
||||
@media(min-width: 48em) {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- This file lives in public/400.html -->
|
||||
|
||||
<main>
|
||||
<header>
|
||||
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm140.456 133.2831c-40.823 0-64.884-35.146-64.884-85.7015 0-50.5554 24.061-85.700907 64.884-85.700907 40.822 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.062 85.7015-64.884 85.7015zm0-133.2831c-17.573 0-22.71 21.8984-22.71 47.5816 0 25.6835 5.137 47.5815 22.71 47.5815 17.302 0 22.709-21.898 22.709-47.5815 0-25.6832-5.407-47.5816-22.709-47.5816z" fill="#f0eff0"/><path d="m123.606 85.4445c3.212 1.0523 5.538 4.2089 5.538 8.0301 0 6.1472-4.209 9.5254-11.298 9.5254h-15.617v-34.0033h14.565c7.089 0 11.353 3.1566 11.353 9.2484 0 3.6551-2.049 6.3134-4.541 7.1994zm-12.904-2.9905h5.095c2.603 0 3.988-.9968 3.988-3.1013 0-2.1044-1.385-3.0459-3.988-3.0459h-5.095zm0 6.6456v6.5902h5.981c2.492 0 3.877-1.3291 3.877-3.2674 0-2.049-1.385-3.3228-3.877-3.3228zm43.786 13.9004h-8.362v-1.274c-.831.831-3.323 1.717-5.981 1.717-4.929 0-9.083-2.769-9.083-8.0301 0-4.818 4.154-7.9193 9.581-7.9193 2.049 0 4.486.6646 5.483 1.3845v-1.606c0-1.606-.942-2.9905-3.046-2.9905-1.606 0-2.548.7199-2.935 1.8275h-8.197c.72-4.8181 4.985-8.6393 11.409-8.6393 7.088 0 11.131 3.7659 11.131 10.2453zm-8.362-6.9779v-1.4399c-.554-1.0522-2.049-1.7167-3.655-1.7167-1.717 0-3.434.7199-3.434 2.3813 0 1.7168 1.717 2.4367 3.434 2.4367 1.606 0 3.101-.6645 3.655-1.6614zm27.996 6.9779v-1.994c-1.163 1.329-3.599 2.548-6.147 2.548-7.199 0-11.131-5.8151-11.131-13.0145s3.932-13.0143 11.131-13.0143c2.548 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.664-1.3291-2.159-2.326-3.821-2.326-2.99 0-4.763 2.4368-4.763 5.6488s1.773 5.5934 4.763 5.5934c1.717 0 3.157-.9415 3.821-2.326zm35.471-2.049h-3.101v11.2421h-8.806v-34.0033h15.285c7.31 0 12.35 4.1535 12.35 11.5744 0 5.1503-2.603 8.6947-6.757 10.2453l7.975 12.1836h-9.858zm-3.101-15.2849v8.1962h5.538c3.156 0 4.596-1.606 4.596-4.0981s-1.44-4.0981-4.596-4.0981zm36.957 17.8323h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm30.98 27.5234v-10.799c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.9259-11.132-13.0145 0-7.144 3.932-13.0143 11.132-13.0143 2.547 0 4.984 1.2184 6.147 2.5475v-1.9937h8.695v33.726zm0-17.9981v-6.5902c-.665-1.3291-2.105-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.661 0 3.156-.9415 3.821-2.326zm36.789-15.7279v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.996 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm19.084 16.2263h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.515-13.0143 7.643 0 11.963 5.095 11.963 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.156-.7753 3.655-2.4921zm-3.822-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm13.428 11.0206h8.474c.387 1.3845 1.606 2.1598 3.156 2.1598 1.44 0 2.548-.5538 2.548-1.7168 0-.9414-.72-1.2737-1.939-1.5506l-4.873-.9969c-4.154-.886-6.867-2.8797-6.867-7.2547 0-5.3165 4.762-8.4178 10.633-8.4178 6.812 0 10.522 3.1567 11.297 8.0855h-8.03c-.277-1.0522-1.052-1.9937-3.046-1.9937-1.273 0-2.326.5538-2.326 1.6614 0 .7753.554 1.163 1.717 1.3845l4.929 1.163c4.541 1.0522 6.978 3.4335 6.978 7.4763 0 5.3168-4.818 8.2518-10.91 8.2518-6.369 0-10.965-2.88-11.741-8.2518zm27.538-.8861v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.993-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.871 0-9.193-2.769-9.193-9.0819z" fill="#d30001"/></svg>
|
||||
</header>
|
||||
<article>
|
||||
<p><strong>The server cannot process the request due to a client error.</strong> Please check the request and try again. If you're the application owner check the logs for more information.</p>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
145
public/404.html
145
public/404.html
|
@ -1,114 +1,67 @@
|
|||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title>The page you were looking for doesn't exist (404 Not found)</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1, width=device-width">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
<title>The page you were looking for doesn't exist (404)</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1">
|
||||
<style>
|
||||
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
* {
|
||||
.rails-default-error-page {
|
||||
background-color: #EFEFEF;
|
||||
color: #2E2F30;
|
||||
text-align: center;
|
||||
font-family: arial, sans-serif;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
.rails-default-error-page div.dialog {
|
||||
width: 95%;
|
||||
max-width: 33em;
|
||||
margin: 4em auto 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #FFF;
|
||||
color: #261B23;
|
||||
display: grid;
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-size: clamp(1rem, 2.5vw, 2rem);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
letter-spacing: -0.0025em;
|
||||
line-height: 1.4;
|
||||
min-height: 100vh;
|
||||
place-items: center;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
.rails-default-error-page div.dialog > div {
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #BBB;
|
||||
border-top: #B00100 solid 4px;
|
||||
border-top-left-radius: 9px;
|
||||
border-top-right-radius: 9px;
|
||||
background-color: white;
|
||||
padding: 7px 12% 0;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.0925em;
|
||||
.rails-default-error-page h1 {
|
||||
font-size: 100%;
|
||||
color: #730E15;
|
||||
line-height: 1.5em;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
font-weight: 700;
|
||||
.rails-default-error-page div.dialog > p {
|
||||
margin: 0 0 1em;
|
||||
padding: 1em;
|
||||
background-color: #F7F7F7;
|
||||
border: 1px solid #CCC;
|
||||
border-right-color: #999;
|
||||
border-left-color: #999;
|
||||
border-bottom-color: #999;
|
||||
border-bottom-left-radius: 4px;
|
||||
border-bottom-right-radius: 4px;
|
||||
border-top-color: #DADADA;
|
||||
color: #666;
|
||||
box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
|
||||
}
|
||||
|
||||
i, em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
main {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
padding: 2em;
|
||||
place-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main header {
|
||||
width: min(100%, 12em);
|
||||
}
|
||||
|
||||
main header svg {
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
main article {
|
||||
width: min(100%, 30em);
|
||||
}
|
||||
|
||||
main article p {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
main article br {
|
||||
|
||||
display: none;
|
||||
|
||||
@media(min-width: 48em) {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<body class="rails-default-error-page">
|
||||
<!-- This file lives in public/404.html -->
|
||||
|
||||
<main>
|
||||
<header>
|
||||
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm165.328-35.41581-45.689 100.02991h26.224v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.184v-31.901l50.285-103.27391z" fill="#f0eff0"/><path d="m157.758 68.9967v34.0033h-7.199l-14.233-19.8814v19.8814h-8.584v-34.0033h8.307l13.125 18.7184v-18.7184zm28.454 21.5428c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.528 0c0-3.4336-1.496-5.8703-4.209-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.209-2.3813 4.209-5.8149zm13.184 3.8766v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm37.027 8.5839h-8.806v-34.0033h23.924v7.6978h-15.118v6.7564h13.9v7.5316h-13.9zm41.876-12.4605c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm35.337-12.4605v24.921h-8.695v-2.16c-1.329 1.551-3.821 2.714-6.646 2.714-5.482 0-8.75-3.5999-8.75-9.1379v-16.3371h8.64v14.288c0 2.1045.997 3.5997 3.212 3.5997 1.606 0 3.101-1.0522 3.544-2.769v-15.1187zm4.076 24.921v-24.921h8.694v2.1598c1.385-1.5506 3.822-2.7136 6.701-2.7136 5.538 0 8.806 3.5997 8.806 9.1377v16.3371h-8.639v-14.2327c0-2.049-1.053-3.5443-3.268-3.5443-1.717 0-3.156.9969-3.6 2.7136v15.0634zm44.113 0v-1.994c-1.163 1.329-3.6 2.548-6.147 2.548-7.2 0-11.132-5.8151-11.132-13.0145s3.932-13.0143 11.132-13.0143c2.547 0 4.984 1.2184 6.147 2.5475v-13.0697h8.695v35.997zm0-9.1931v-6.5902c-.665-1.3291-2.16-2.326-3.821-2.326-2.991 0-4.763 2.4368-4.763 5.6488s1.772 5.5934 4.763 5.5934c1.717 0 3.156-.9415 3.821-2.326z" fill="#d30001"/></svg>
|
||||
</header>
|
||||
<article>
|
||||
<p><strong>The page you were looking for doesn't exist.</strong> You may have mistyped the address or the page may have moved. If you're the application owner check the logs for more information.</p>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
<div class="dialog">
|
||||
<div>
|
||||
<h1>The page you were looking for doesn't exist.</h1>
|
||||
<p>You may have mistyped the address or the page may have moved.</p>
|
||||
</div>
|
||||
<p>If you are the application owner check the logs for more information.</p>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -1,114 +0,0 @@
|
|||
<!doctype html>
|
||||
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
|
||||
<title>Your browser is not supported (406 Not Acceptable)</title>
|
||||
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="initial-scale=1, width=device-width">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
|
||||
<style>
|
||||
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
html {
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
body {
|
||||
background: #FFF;
|
||||
color: #261B23;
|
||||
display: grid;
|
||||
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Aptos, Roboto, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
font-size: clamp(1rem, 2.5vw, 2rem);
|
||||
-webkit-font-smoothing: antialiased;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
letter-spacing: -0.0025em;
|
||||
line-height: 1.4;
|
||||
min-height: 100vh;
|
||||
place-items: center;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-text-size-adjust: 100%;
|
||||
}
|
||||
|
||||
a {
|
||||
color: inherit;
|
||||
font-weight: 700;
|
||||
text-decoration: underline;
|
||||
text-underline-offset: 0.0925em;
|
||||
}
|
||||
|
||||
b, strong {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
i, em {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
main {
|
||||
display: grid;
|
||||
gap: 1em;
|
||||
padding: 2em;
|
||||
place-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
main header {
|
||||
width: min(100%, 12em);
|
||||
}
|
||||
|
||||
main header svg {
|
||||
height: auto;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
main article {
|
||||
width: min(100%, 30em);
|
||||
}
|
||||
|
||||
main article p {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
main article br {
|
||||
|
||||
display: none;
|
||||
|
||||
@media(min-width: 48em) {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<!-- This file lives in public/406-unsupported-browser.html -->
|
||||
|
||||
<main>
|
||||
<header>
|
||||
<svg height="172" viewBox="0 0 480 172" width="480" xmlns="http://www.w3.org/2000/svg"><path d="m124.48 3.00509-45.6889 100.02991h26.2239v-28.1168h38.119v28.1168h21.628v35.145h-21.628v30.82h-37.308v-30.82h-72.1833v-31.901l50.2851-103.27391zm115.583 168.69891c-40.822 0-64.884-35.146-64.884-85.7015 0-50.5554 24.062-85.700907 64.884-85.700907 40.823 0 64.884 35.145507 64.884 85.700907 0 50.5555-24.061 85.7015-64.884 85.7015zm0-133.2831c-17.572 0-22.709 21.8984-22.709 47.5816 0 25.6835 5.137 47.5815 22.709 47.5815 17.303 0 22.71-21.898 22.71-47.5815 0-25.6832-5.407-47.5816-22.71-47.5816zm202.906 9.7326h-41.093c-2.433-7.2994-7.84-12.4361-17.302-12.4361-16.221 0-25.413 17.5728-25.954 34.8752v1.3517c5.137-7.0291 16.221-12.4361 30.82-12.4361 33.524 0 54.881 24.0612 54.881 53.7998 0 33.253-23.791 58.396-61.64 58.396-21.628 0-39.741-10.003-50.825-27.576-9.733-14.599-13.788-32.442-13.788-54.3406 0-51.9072 24.331-89.485807 66.236-89.485807 32.712 0 53.258 18.654107 58.665 47.851907zm-82.727 66.2355c0 13.247 9.463 22.439 22.71 22.439 12.977 0 22.439-9.192 22.439-22.439 0-13.517-9.462-22.7091-22.439-22.7091-13.247 0-22.71 9.1921-22.71 22.7091z" fill="#f0eff0"/><path d="m100.761 68.9967v34.0033h-7.1991l-14.2326-19.8814v19.8814h-8.5839v-34.0033h8.307l13.125 18.7184v-18.7184zm28.454 21.5428c0 7.6978-5.15 13.0145-12.737 13.0145-7.532 0-12.738-5.3167-12.738-13.0145s5.206-13.0143 12.738-13.0143c7.587 0 12.737 5.3165 12.737 13.0143zm-8.529 0c0-3.4336-1.495-5.8703-4.208-5.8703-2.659 0-4.154 2.4367-4.154 5.8703s1.495 5.8149 4.154 5.8149c2.713 0 4.208-2.3813 4.208-5.8149zm13.185 3.8766v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.205v6.7564h-5.205v8.307c0 1.9383.941 2.769 2.658 2.769.941 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm39.02-25.4194h9.083l12.958 34.0033h-9.027l-2.436-6.5902h-12.35l-2.381 6.5902h-8.806zm4.431 10.5222-3.489 9.5807h6.978zm17.44 11.0206c0-7.6978 5.095-13.0143 12.572-13.0143 6.701 0 10.854 3.9874 11.574 9.8023h-8.418c-.221-1.4953-1.384-2.6029-3.156-2.6029-2.437 0-3.988 2.2706-3.988 5.8149s1.551 5.7595 3.988 5.7595c1.772 0 2.935-1.0522 3.156-2.5475h8.418c-.72 5.7596-4.873 9.8025-11.574 9.8025-7.477 0-12.572-5.3167-12.572-13.0145zm25.676 0c0-7.6978 5.095-13.0143 12.572-13.0143 6.701 0 10.854 3.9874 11.574 9.8023h-8.418c-.221-1.4953-1.384-2.6029-3.156-2.6029-2.437 0-3.988 2.2706-3.988 5.8149s1.551 5.7595 3.988 5.7595c1.772 0 2.935-1.0522 3.156-2.5475h8.418c-.72 5.7596-4.873 9.8025-11.574 9.8025-7.477 0-12.572-5.3167-12.572-13.0145zm42.013 3.7658h8.031c-.887 5.7597-5.206 9.2487-11.686 9.2487-7.642 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.317-13.0143 12.516-13.0143 7.643 0 11.962 5.095 11.962 12.5159v2.1598h-16.115c.277 2.9905 1.827 4.5965 4.319 4.5965 1.773 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.433 1.2737-3.987 3.5997h7.532c-.111-2.0491-1.385-3.5997-3.545-3.5997zm23.4 16.7244v10.799h-8.694v-33.726h8.694v1.9937c1.163-1.3291 3.6-2.5475 6.148-2.5475 7.199 0 11.131 5.8703 11.131 13.0143 0 7.0886-3.932 13.0145-11.131 13.0145-2.548 0-4.985-1.219-6.148-2.548zm0-13.7893v6.5902c.665 1.3845 2.16 2.326 3.822 2.326 2.99 0 4.762-2.3814 4.762-5.5934s-1.772-5.6488-4.762-5.6488c-1.717 0-3.157.9969-3.822 2.326zm21.892 7.1994v-9.5807h-3.655v-6.7564h3.655v-6.8671h8.584v6.8671h5.206v6.7564h-5.206v8.307c0 1.9383.941 2.769 2.658 2.769.942 0 1.994-.2216 2.769-.5538v7.3654c-.997.443-2.88.775-4.818.775-5.87 0-9.193-2.769-9.193-9.0819zm39.458 8.5839h-8.363v-1.274c-.83.831-3.322 1.717-5.981 1.717-4.928 0-9.082-2.769-9.082-8.0301 0-4.818 4.154-7.9193 9.581-7.9193 2.049 0 4.486.6646 5.482 1.3845v-1.606c0-1.606-.941-2.9905-3.045-2.9905-1.606 0-2.548.7199-2.936 1.8275h-8.196c.72-4.8181 4.984-8.6393 11.408-8.6393 7.089 0 11.132 3.7659 11.132 10.2453zm-8.363-6.9779v-1.4399c-.553-1.0522-2.049-1.7167-3.655-1.7167-1.716 0-3.433.7199-3.433 2.3813 0 1.7168 1.717 2.4367 3.433 2.4367 1.606 0 3.102-.6645 3.655-1.6614zm20.742 4.9839v1.994h-8.694v-35.997h8.694v13.0697c1.163-1.3291 3.6-2.5475 6.148-2.5475 7.199 0 11.131 5.8149 11.131 13.0143s-3.932 13.0145-11.131 13.0145c-2.548 0-4.985-1.219-6.148-2.548zm0-13.7893v6.5902c.665 1.3845 2.105 2.326 3.822 2.326 2.99 0 4.762-2.3814 4.762-5.5934s-1.772-5.6488-4.762-5.6488c-1.662 0-3.157.9969-3.822 2.326zm28.759-20.2137v35.997h-8.695v-35.997zm19.172 27.3023h8.03c-.886 5.7597-5.206 9.2487-11.685 9.2487-7.643 0-12.682-5.2613-12.682-13.0145 0-7.6978 5.316-13.0143 12.516-13.0143 7.642 0 11.962 5.095 11.962 12.5159v2.1598h-16.116c.277 2.9905 1.828 4.5965 4.32 4.5965 1.772 0 3.157-.7753 3.655-2.4921zm-3.821-10.0237c-2.049 0-3.434 1.2737-3.988 3.5997h7.532c-.111-2.0491-1.384-3.5997-3.544-3.5997z" fill="#d30001"/></svg>
|
||||
</header>
|
||||
<article>
|
||||
<p><strong>Your browser is not supported.</strong><br> Please upgrade your browser to continue.</p>
|
||||
</article>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
145
public/422.html
145
public/422.html
File diff suppressed because one or more lines are too long
144
public/500.html
144
public/500.html
File diff suppressed because one or more lines are too long
BIN
public/icon.png
BIN
public/icon.png
Binary file not shown.
Before Width: | Height: | Size: 4.1 KiB |
|
@ -1,3 +0,0 @@
|
|||
<svg width="512" height="512" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="256" cy="256" r="256" fill="red"/>
|
||||
</svg>
|
Before Width: | Height: | Size: 122 B |
|
@ -4,15 +4,4 @@ class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
|
|||
driven_by :selenium,
|
||||
using: ENV["VISIBLE_SYSTEM_TESTS"].present? ? :chrome : :headless_chrome,
|
||||
screen_size: [1400, 1400]
|
||||
|
||||
def login(email, password = "secret")
|
||||
visit new_session_url
|
||||
|
||||
fill_in "Email", with: email
|
||||
fill_in "Password", with: "secret"
|
||||
|
||||
click_on "Create Session"
|
||||
|
||||
assert_text "Session was successfully created"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
require "test_helper"
|
||||
|
||||
class SessionsControllerTest < ActionDispatch::IntegrationTest
|
||||
test "should get new" do
|
||||
get new_session_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create session" do
|
||||
user = users(:one)
|
||||
params = {
|
||||
session: {
|
||||
email: user.email,
|
||||
password: "secret"
|
||||
}
|
||||
}
|
||||
post sessions_url, params: params
|
||||
|
||||
assert_redirected_to root_url
|
||||
end
|
||||
|
||||
test "should destroy session" do
|
||||
login(users(:one).email)
|
||||
delete session_url(@session)
|
||||
|
||||
assert_redirected_to new_session_url
|
||||
end
|
||||
end
|
|
@ -1,62 +0,0 @@
|
|||
require "test_helper"
|
||||
|
||||
class UsersControllerTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@user = users(:one)
|
||||
end
|
||||
|
||||
test "should get index" do
|
||||
login(@user.email)
|
||||
get users_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get new" do
|
||||
get new_user_url
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should create user" do
|
||||
stub_environment(REGISTRATION_ALLOWED: "true") do
|
||||
assert_difference("User.count") do
|
||||
params = {
|
||||
user: {
|
||||
email: "userthree@example.local",
|
||||
password: "secret",
|
||||
password_confirmation: "secret"
|
||||
}
|
||||
}
|
||||
post users_url, params: params
|
||||
end
|
||||
end
|
||||
|
||||
assert_redirected_to user_url(User.last)
|
||||
end
|
||||
|
||||
test "should show user" do
|
||||
login(@user.email)
|
||||
get user_url(@user)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should get edit" do
|
||||
login(@user.email)
|
||||
get edit_user_url(@user)
|
||||
assert_response :success
|
||||
end
|
||||
|
||||
test "should update user" do
|
||||
login(@user.email)
|
||||
patch user_url(@user), params: { user: { email: @user.email, password: "secret", password_confirmation: "secret" } }
|
||||
assert_redirected_to user_url(@user)
|
||||
end
|
||||
|
||||
test "should destroy user" do
|
||||
login(@user.email)
|
||||
assert_difference("User.count", -1) do
|
||||
delete user_url(@user)
|
||||
end
|
||||
|
||||
assert_redirected_to users_url
|
||||
end
|
||||
end
|
9
test/fixtures/users.yml
vendored
9
test/fixtures/users.yml
vendored
|
@ -1,9 +0,0 @@
|
|||
# Read about fixtures at https://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
|
||||
|
||||
one:
|
||||
email: userone@example.local
|
||||
password_digest: <%= BCrypt::Password.create("secret") %>
|
||||
|
||||
two:
|
||||
email: usertwo@example.local
|
||||
password_digest: <%= BCrypt::Password.create("secret") %>
|
|
@ -1,11 +0,0 @@
|
|||
require "test_helper"
|
||||
|
||||
class GuestUserTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@user = GuestUser.new
|
||||
end
|
||||
|
||||
def test_registered_false
|
||||
assert_not @user.registered?
|
||||
end
|
||||
end
|
|
@ -1,25 +0,0 @@
|
|||
require "test_helper"
|
||||
|
||||
class SessionTest < ActiveSupport::TestCase
|
||||
def test_save_when_exists
|
||||
user = users(:one)
|
||||
|
||||
session = Session.new(email: user.email, password: "secret")
|
||||
|
||||
assert session.save
|
||||
end
|
||||
|
||||
def test_save_when_not_exists
|
||||
session = Session.new(email: "fake@example.org", password: "secret")
|
||||
|
||||
assert_not session.save
|
||||
end
|
||||
|
||||
def test_save_when_password_incorrect
|
||||
user = users(:one)
|
||||
|
||||
session = Session.new(email: user.email, password: "bad_password")
|
||||
|
||||
assert_not session.save
|
||||
end
|
||||
end
|
|
@ -1,11 +0,0 @@
|
|||
require "test_helper"
|
||||
|
||||
class UserTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@user = users(:one)
|
||||
end
|
||||
|
||||
def test_registered_true
|
||||
assert @user.registered?
|
||||
end
|
||||
end
|
|
@ -3,7 +3,6 @@ require "application_system_test_case"
|
|||
class CreditCardBillsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@credit_card_bill = credit_card_bills(:one)
|
||||
login(users(:one).email)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
|
|
|
@ -3,7 +3,6 @@ require "application_system_test_case"
|
|||
class ExpensesTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@expense = expenses(:monthly_expense)
|
||||
login(users(:one).email)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
|
|
|
@ -3,7 +3,6 @@ require "application_system_test_case"
|
|||
class IncomesTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@income = incomes(:included_1)
|
||||
login(users(:one).email)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
|
|
|
@ -3,7 +3,6 @@ require "application_system_test_case"
|
|||
class MembersTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@member = members(:one)
|
||||
login(users(:one).email)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
require "application_system_test_case"
|
||||
|
||||
class SessionsTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@user = users(:one)
|
||||
end
|
||||
|
||||
test "should create session" do
|
||||
login(@user.email)
|
||||
|
||||
assert_text "Session was successfully created"
|
||||
end
|
||||
|
||||
test "should destroy Session" do
|
||||
login(@user.email)
|
||||
|
||||
visit root_url
|
||||
click_on "Log out", match: :first
|
||||
|
||||
assert_text "Session was successfully destroyed"
|
||||
end
|
||||
end
|
|
@ -1,50 +0,0 @@
|
|||
require "application_system_test_case"
|
||||
|
||||
class UsersTest < ApplicationSystemTestCase
|
||||
setup do
|
||||
@user = users(:one)
|
||||
end
|
||||
|
||||
test "visiting the index" do
|
||||
login(@user.email)
|
||||
visit users_url
|
||||
assert_selector "h1", text: "Users"
|
||||
end
|
||||
|
||||
test "should create user" do
|
||||
visit users_url
|
||||
click_on "Sign up"
|
||||
|
||||
stub_environment(REGISTRATION_ALLOWED: "true") do
|
||||
fill_in "Email", with: "userthree@example.local"
|
||||
fill_in "Password", with: "secret"
|
||||
fill_in "Password confirmation", with: "secret"
|
||||
click_on "Create User"
|
||||
|
||||
assert_text "User was successfully created"
|
||||
end
|
||||
click_on "Back"
|
||||
end
|
||||
|
||||
test "should update User" do
|
||||
login(@user.email)
|
||||
visit user_url(@user)
|
||||
click_on "Edit this user", match: :first
|
||||
|
||||
fill_in "Email", with: "newemail@example.local"
|
||||
fill_in "Password", with: "newpassword"
|
||||
fill_in "Password confirmation", with: "newpassword"
|
||||
click_on "Update User"
|
||||
|
||||
assert_text "User was successfully updated"
|
||||
click_on "Back"
|
||||
end
|
||||
|
||||
test "should destroy User" do
|
||||
login(@user.email)
|
||||
visit user_url(users(:two))
|
||||
click_on "Destroy this user", match: :first
|
||||
|
||||
assert_text "User was successfully destroyed"
|
||||
end
|
||||
end
|
|
@ -10,19 +10,4 @@ class ActiveSupport::TestCase
|
|||
fixtures :all
|
||||
|
||||
# Add more helper methods to be used by all tests here...
|
||||
def login(email, password = "secret")
|
||||
post sessions_url, params: { session: { email: email, password: password } }
|
||||
assert session[:current_user_id].present?
|
||||
end
|
||||
|
||||
def stub_environment(env)
|
||||
old_env = ENV.to_hash
|
||||
ENV.update(env.stringify_keys)
|
||||
|
||||
begin
|
||||
yield
|
||||
ensure
|
||||
ENV.replace(old_env)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue