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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co

## Project Overview

This is a Rails 7.2 API application that serves as the backend for NativeAppTemplate iOS/Android mobile applications. It's a multi-tenant SaaS application with token-based authentication, role-based authorization, and RESTful API endpoints. Ruby 4.0.1, PostgreSQL, Redis, Sidekiq.
This is a Rails 8.0 API application that serves as the backend for NativeAppTemplate iOS/Android mobile applications. It's a multi-tenant SaaS application with token-based authentication, role-based authorization, and RESTful API endpoints. Ruby 4.0.1, PostgreSQL, Redis, Sidekiq.

## Development Commands

Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby file: ".ruby-version"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", "~> 7.2.3"
gem "rails", "~> 8.0.0"

gem "propshaft", "~> 1.0"

Expand Down
148 changes: 73 additions & 75 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,68 +13,65 @@ GEM
specs:
aasm (5.5.0)
concurrent-ruby (~> 1.0)
actioncable (7.2.3)
actionpack (= 7.2.3)
activesupport (= 7.2.3)
actioncable (8.0.4)
actionpack (= 8.0.4)
activesupport (= 8.0.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.2.3)
actionpack (= 7.2.3)
activejob (= 7.2.3)
activerecord (= 7.2.3)
activestorage (= 7.2.3)
activesupport (= 7.2.3)
actionmailbox (8.0.4)
actionpack (= 8.0.4)
activejob (= 8.0.4)
activerecord (= 8.0.4)
activestorage (= 8.0.4)
activesupport (= 8.0.4)
mail (>= 2.8.0)
actionmailer (7.2.3)
actionpack (= 7.2.3)
actionview (= 7.2.3)
activejob (= 7.2.3)
activesupport (= 7.2.3)
actionmailer (8.0.4)
actionpack (= 8.0.4)
actionview (= 8.0.4)
activejob (= 8.0.4)
activesupport (= 8.0.4)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (7.2.3)
actionview (= 7.2.3)
activesupport (= 7.2.3)
cgi
actionpack (8.0.4)
actionview (= 8.0.4)
activesupport (= 8.0.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4, < 3.3)
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 (7.2.3)
actionpack (= 7.2.3)
activerecord (= 7.2.3)
activestorage (= 7.2.3)
activesupport (= 7.2.3)
actiontext (8.0.4)
actionpack (= 8.0.4)
activerecord (= 8.0.4)
activestorage (= 8.0.4)
activesupport (= 8.0.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.2.3)
activesupport (= 7.2.3)
actionview (8.0.4)
activesupport (= 8.0.4)
builder (~> 3.1)
cgi
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.2.3)
activesupport (= 7.2.3)
activejob (8.0.4)
activesupport (= 8.0.4)
globalid (>= 0.3.6)
activemodel (7.2.3)
activesupport (= 7.2.3)
activerecord (7.2.3)
activemodel (= 7.2.3)
activesupport (= 7.2.3)
activemodel (8.0.4)
activesupport (= 8.0.4)
activerecord (8.0.4)
activemodel (= 8.0.4)
activesupport (= 8.0.4)
timeout (>= 0.4.0)
activestorage (7.2.3)
actionpack (= 7.2.3)
activejob (= 7.2.3)
activerecord (= 7.2.3)
activesupport (= 7.2.3)
activestorage (8.0.4)
actionpack (= 8.0.4)
activejob (= 8.0.4)
activerecord (= 8.0.4)
activesupport (= 8.0.4)
marcel (~> 1.0)
activesupport (7.2.3)
activesupport (8.0.4)
base64
benchmark (>= 0.3)
bigdecimal
Expand All @@ -86,6 +83,7 @@ GEM
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
acts_as_tenant (1.0.1)
rails (>= 6.0)
addressable (2.8.7)
Expand Down Expand Up @@ -120,7 +118,6 @@ GEM
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
xpath (~> 3.2)
cgi (0.5.1)
childprocess (5.1.0)
logger (~> 1.5)
chronic (0.10.2)
Expand All @@ -147,12 +144,12 @@ GEM
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
devise_token_auth (1.2.5)
devise_token_auth (1.2.6)
bcrypt (~> 3.0)
devise (> 3.5.2, < 5)
rails (>= 4.2.0, < 8.1)
rails (>= 4.2.0, < 8.2)
drb (2.2.3)
erb (6.0.1)
erb (6.0.2)
erb_lint (0.9.0)
activesupport
better_html (>= 2.0.1)
Expand Down Expand Up @@ -185,8 +182,9 @@ GEM
activesupport (>= 3.0)
nokogiri (>= 1.6)
io-console (0.8.2)
irb (1.16.0)
irb (1.17.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
jbuilder (2.13.0)
Expand Down Expand Up @@ -225,7 +223,7 @@ GEM
mini_portile2 (2.8.9)
minitest (5.27.0)
msgpack (1.8.0)
net-imap (0.6.2)
net-imap (0.6.3)
date
net-protocol
net-pop (0.1.2)
Expand All @@ -235,18 +233,18 @@ GEM
net-smtp (0.5.1)
net-protocol
nio4r (2.7.5)
nokogiri (1.19.0)
nokogiri (1.19.1)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
nokogiri (1.19.0-aarch64-linux-gnu)
nokogiri (1.19.1-aarch64-linux-gnu)
racc (~> 1.4)
nokogiri (1.19.0-arm-linux-gnu)
nokogiri (1.19.1-arm-linux-gnu)
racc (~> 1.4)
nokogiri (1.19.0-arm64-darwin)
nokogiri (1.19.1-arm64-darwin)
racc (~> 1.4)
nokogiri (1.19.0-x86_64-darwin)
nokogiri (1.19.1-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.19.0-x86_64-linux-gnu)
nokogiri (1.19.1-x86_64-linux-gnu)
racc (~> 1.4)
orm_adapter (0.5.0)
ostruct (0.6.1)
Expand Down Expand Up @@ -290,31 +288,30 @@ GEM
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
rails (7.2.3)
actioncable (= 7.2.3)
actionmailbox (= 7.2.3)
actionmailer (= 7.2.3)
actionpack (= 7.2.3)
actiontext (= 7.2.3)
actionview (= 7.2.3)
activejob (= 7.2.3)
activemodel (= 7.2.3)
activerecord (= 7.2.3)
activestorage (= 7.2.3)
activesupport (= 7.2.3)
rails (8.0.4)
actioncable (= 8.0.4)
actionmailbox (= 8.0.4)
actionmailer (= 8.0.4)
actionpack (= 8.0.4)
actiontext (= 8.0.4)
actionview (= 8.0.4)
activejob (= 8.0.4)
activemodel (= 8.0.4)
activerecord (= 8.0.4)
activestorage (= 8.0.4)
activesupport (= 8.0.4)
bundler (>= 1.15.0)
railties (= 7.2.3)
railties (= 8.0.4)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
rails-html-sanitizer (1.7.0)
loofah (~> 2.25)
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)
railties (7.2.3)
actionpack (= 7.2.3)
activesupport (= 7.2.3)
cgi
railties (8.0.4)
actionpack (= 8.0.4)
activesupport (= 8.0.4)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
Expand All @@ -323,7 +320,7 @@ GEM
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.3.1)
rdoc (7.0.3)
rdoc (7.2.0)
erb
psych (>= 4.0.0)
tsort
Expand Down Expand Up @@ -408,6 +405,7 @@ GEM
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1)
useragent (0.16.11)
valid_email2 (7.0.0)
activemodel (>= 6.0)
Expand All @@ -432,7 +430,7 @@ GEM
chronic (>= 0.6.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.7.4)
zeitwerk (2.7.5)

PLATFORMS
aarch64-linux
Expand Down Expand Up @@ -472,7 +470,7 @@ DEPENDENCIES
pundit
rack-attack
rack-cors
rails (~> 7.2.3)
rails (~> 8.0.0)
redis (~> 5.1)
rubocop-rails-omakase
seed-fu (~> 2.3)
Expand Down
4 changes: 2 additions & 2 deletions app/models/app_version.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class AppVersion < ApplicationRecord
enum current_type: {uncurrent: 1, current: 2}
enum forced_update_type: {unforced_update: 1, forced_update: 2}
enum :current_type, {uncurrent: 1, current: 2}
enum :forced_update_type, {unforced_update: 1, forced_update: 2}

def self.current_version(platform:)
AppVersion
Expand Down
4 changes: 2 additions & 2 deletions app/models/item_tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class ItemTag < ApplicationRecord
belongs_to :created_by, class_name: "Shopkeeper", optional: true
belongs_to :completed_by, class_name: "Shopkeeper", optional: true

enum state: {idled: 1, completed: 2}
enum scan_state: {unscanned: 1, scanned: 2}
enum :state, {idled: 1, completed: 2}
enum :scan_state, {unscanned: 1, scanned: 2}

scope :sorted, -> { order(queue_number: :asc) }
scope :sorted_recent_first_order, -> { order(completed_at: :desc) }
Expand Down
2 changes: 1 addition & 1 deletion app/models/privacy_version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class PrivacyVersion < ApplicationRecord
enum current_type: {uncurrent: 1, current: 2}
enum :current_type, {uncurrent: 1, current: 2}

def self.current_version
PrivacyVersion
Expand Down
2 changes: 1 addition & 1 deletion app/models/terms_version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class TermsVersion < ApplicationRecord
enum current_type: {uncurrent: 1, current: 2}
enum :current_type, {uncurrent: 1, current: 2}

def self.current_version
TermsVersion
Expand Down
12 changes: 4 additions & 8 deletions bin/dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,8 @@
# Default to port 3000 if not specified
export PORT="${PORT:-3000}"

if command -v overmind > /dev/null 2>&1; then
exec overmind start -f Procfile.dev "$@"
else
if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi
exec foreman start -f Procfile.dev "$@"
if ! command -v overmind 2>&1 >/dev/null; then
gem install overmind
fi

exec overmind start -T -f Procfile.dev "$@"
19 changes: 1 addition & 18 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
module Nativeapptemplateapi
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.1
config.load_defaults 8.0

# 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.
Expand Down Expand Up @@ -40,23 +40,6 @@ class Application < Rails::Application
# Use default language as fallback if translation is missing
config.i18n.fallbacks = true

# Prevent sassc-rails from setting sass as the compressor
# Libsass is deprecated and doesn't support modern CSS syntax used by TailwindCSS
config.assets.css_compressor = nil

# Rails 7 defaults to libvips as the variant processor
# libvips is up to 10x faster and consumes 1/10th the memory of imagemagick
# If you need to use imagemagick, uncomment this to switch
# config.active_storage.variant_processor = :mini_magick

# Support older SHA1 digests for ActiveStorage so ActionText attachments don't break
config.after_initialize do |app|
app.message_verifier("ActiveStorage").rotate(digest: "SHA1")
end

# Support older SHA1 digests for ActiveRecord::Encryption
config.active_record.encryption.support_sha1_for_non_deterministic_encryption = true

config.active_model.i18n_customize_full_message = true

# https://github.com/heartcombo/devise/issues/4825
Expand Down
Loading