From df99f800b969e45c0729be62c3c8141d3bd211c2 Mon Sep 17 00:00:00 2001 From: Dan Elbert Date: Mon, 20 Apr 2026 13:46:42 -0500 Subject: [PATCH] Dep upgrades; bug fixes --- .dockerignore | 3 +- .gitignore | 3 +- .ruby-version | 2 +- CLAUDE.md | 73 +++++ Dockerfile | 3 +- Gemfile | 2 +- Gemfile.lock | 288 +++++++++++--------- app/controllers/task_items_controller.rb | 2 +- app/javascript/components/AppSearchText.vue | 25 +- app/javascript/components/TheCalculator.vue | 8 +- app/javascript/components/TheRecipeList.vue | 4 +- app/models/user.rb | 2 +- config/application.rb | 2 +- config/environments/beta.rb | 8 +- config/environments/docker.rb | 6 +- db/schema.rb | 178 ++++++------ 16 files changed, 347 insertions(+), 262 deletions(-) create mode 100644 CLAUDE.md diff --git a/.dockerignore b/.dockerignore index 3a68d3b..699b9df 100644 --- a/.dockerignore +++ b/.dockerignore @@ -6,4 +6,5 @@ public/assets public/packs node_modules/ .yarn -.pnp.* \ No newline at end of file +.pnp.* +.claude \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6b11b7f..86e3f24 100644 --- a/.gitignore +++ b/.gitignore @@ -36,4 +36,5 @@ yarn-debug.log* yarn-debug.log* .yarn-integrity .yarn -.pnp.* \ No newline at end of file +.pnp.* +.claude \ No newline at end of file diff --git a/.ruby-version b/.ruby-version index fa7adc7..4d54dad 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.5 +4.0.2 diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..5f24f59 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,73 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +Parsley is a personal recipe manager and meal planning app. It is a monolithic Rails 7.2 application with a Vue 3 SPA frontend. + +**Backend:** Ruby 4.0.2, Rails 8.1.3, SQLite (dev/test), PostgreSQL (production) +**Frontend:** Vue 3 (Composition API / ` \ No newline at end of file diff --git a/app/javascript/components/TheCalculator.vue b/app/javascript/components/TheCalculator.vue index 090ab39..08ab698 100644 --- a/app/javascript/components/TheCalculator.vue +++ b/app/javascript/components/TheCalculator.vue @@ -87,10 +87,10 @@ return api.getSearchIngredients(text); } - function searchItemSelected(ingredient) { - ingredient.value = ingredient || null; - ingredient_name.value = ingredient.name || null; - density.value = ingredient.density || null; + function searchItemSelected(selectedIngredient) { + ingredient.value = selectedIngredient || null; + ingredient_name.value = selectedIngredient.name || null; + density.value = selectedIngredient.density || null; } function getErrors(type) { diff --git a/app/javascript/components/TheRecipeList.vue b/app/javascript/components/TheRecipeList.vue index 94f0028..5c53b0b 100644 --- a/app/javascript/components/TheRecipeList.vue +++ b/app/javascript/components/TheRecipeList.vue @@ -25,10 +25,10 @@ - + - + diff --git a/app/models/user.rb b/app/models/user.rb index ca60665..3c5a5d9 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -9,7 +9,7 @@ class User < ApplicationRecord validates :username, presence: true, uniqueness: { case_sensitive: false } def self.authenticate(username, password) - find_by_username(username).try(:authenticate, password) + find_by(username: username)&.authenticate(password) end def display_name diff --git a/config/application.rb b/config/application.rb index c8f20d0..786c018 100644 --- a/config/application.rb +++ b/config/application.rb @@ -24,7 +24,7 @@ require_relative '../lib/unit_conversion' module Parsley class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. - config.load_defaults 7.2 + config.load_defaults 8.0 config.autoload_lib(ignore: %w(assets tasks unit_conversion unit_conversion.rb)) diff --git a/config/environments/beta.rb b/config/environments/beta.rb index 910f877..155bf16 100644 --- a/config/environments/beta.rb +++ b/config/environments/beta.rb @@ -1,10 +1,8 @@ Rails.application.configure do - # Verifies that versions and hashed value of the package contents in the project's package.json - config.webpacker.check_yarn_integrity = false # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -68,8 +66,8 @@ Rails.application.configure do # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify + # Don't log any deprecations. + config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new diff --git a/config/environments/docker.rb b/config/environments/docker.rb index beba7c0..fbb48eb 100644 --- a/config/environments/docker.rb +++ b/config/environments/docker.rb @@ -2,7 +2,7 @@ Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. # Code is not reloaded between requests. - config.cache_classes = true + config.enable_reloading = false # Eager load code on boot. This eager loads most of Rails and # your application in memory, allowing both threaded web servers @@ -56,8 +56,8 @@ Rails.application.configure do # the I18n.default_locale when a translation cannot be found). config.i18n.fallbacks = true - # Send deprecation notices to registered listeners. - config.active_support.deprecation = :notify + # Don't log any deprecations. + config.active_support.report_deprecations = false # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new diff --git a/db/schema.rb b/db/schema.rb index be80720..fd4d7ea 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,107 +10,107 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.2].define(version: 2018_09_15_134841) do +ActiveRecord::Schema[8.1].define(version: 2018_09_15_134841) do create_table "food_units", force: :cascade do |t| t.integer "food_id", null: false - t.string "name", null: false t.decimal "gram_weight", precision: 10, scale: 2, null: false + t.string "name", null: false t.index ["food_id"], name: "index_food_units_on_food_id" end create_table "foods", force: :cascade do |t| - t.string "name" - t.string "density" - t.text "notes" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.string "ndbn", limit: 25 - t.decimal "water", precision: 10, scale: 2 - t.decimal "protein", precision: 10, scale: 2 - t.decimal "lipids", precision: 10, scale: 2 t.decimal "ash", precision: 10, scale: 2 - t.decimal "carbohydrates", precision: 10, scale: 2 - t.integer "kcal" - t.decimal "fiber", precision: 10, scale: 1 - t.decimal "sugar", precision: 10, scale: 2 - t.integer "user_id" t.integer "calcium" + t.decimal "carbohydrates", precision: 10, scale: 2 + t.decimal "cholesterol", precision: 10, scale: 3 + t.decimal "copper", precision: 10, scale: 3 + t.datetime "created_at", precision: nil, null: false + t.string "density" + t.decimal "fiber", precision: 10, scale: 1 t.decimal "iron", precision: 10, scale: 2 + t.integer "kcal" + t.decimal "lipids", precision: 10, scale: 2 t.integer "magnesium" + t.decimal "manganese", precision: 10, scale: 3 + t.string "name" + t.string "ndbn", limit: 25 + t.text "notes" t.integer "phosphorus" t.integer "potassium" + t.decimal "protein", precision: 10, scale: 2 t.integer "sodium" - t.decimal "zinc", precision: 10, scale: 2 - t.decimal "copper", precision: 10, scale: 3 - t.decimal "manganese", precision: 10, scale: 3 - t.decimal "vit_c", precision: 10, scale: 1 - t.decimal "vit_b6", precision: 10, scale: 3 - t.decimal "vit_b12", precision: 10, scale: 2 + t.decimal "sugar", precision: 10, scale: 2 + t.datetime "updated_at", precision: nil, null: false + t.integer "user_id" t.integer "vit_a" - t.decimal "vit_e", precision: 10, scale: 2 + t.decimal "vit_b12", precision: 10, scale: 2 + t.decimal "vit_b6", precision: 10, scale: 3 + t.decimal "vit_c", precision: 10, scale: 1 t.decimal "vit_d", precision: 10, scale: 1 + t.decimal "vit_e", precision: 10, scale: 2 t.decimal "vit_k", precision: 10, scale: 1 - t.decimal "cholesterol", precision: 10, scale: 3 + t.decimal "water", precision: 10, scale: 2 + t.decimal "zinc", precision: 10, scale: 2 t.index ["ndbn"], name: "index_foods_on_ndbn" end create_table "logs", force: :cascade do |t| - t.integer "user_id" + t.datetime "created_at", precision: nil, null: false + t.datetime "date", precision: nil + t.text "notes" + t.integer "rating" t.integer "recipe_id" t.integer "source_recipe_id" - t.datetime "date", precision: nil - t.integer "rating" - t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false - t.text "notes" + t.integer "user_id" end create_table "notes", force: :cascade do |t| - t.integer "user_id", null: false t.text "content", null: false t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false + t.integer "user_id", null: false t.index ["user_id"], name: "index_notes_on_user_id" end create_table "recipe_ingredients", force: :cascade do |t| - t.integer "food_id" - t.integer "recipe_id" - t.string "name" - t.integer "sort_order" - t.string "quantity" - t.string "units" t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false + t.integer "food_id" + t.string "name" t.text "preparation" + t.string "quantity" t.integer "recipe_as_ingredient_id" + t.integer "recipe_id" + t.integer "sort_order" + t.string "units" + t.datetime "updated_at", precision: nil, null: false t.index ["recipe_id"], name: "index_recipe_ingredients_on_recipe_id" end create_table "recipe_steps", force: :cascade do |t| + t.datetime "created_at", precision: nil, null: false t.integer "recipe_id" t.integer "sort_order" t.text "step" - t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false t.index ["recipe_id"], name: "index_recipe_steps_on_recipe_id" end create_table "recipes", force: :cascade do |t| - t.string "name" - t.text "description" - t.text "source" - t.string "yields" - t.integer "total_time" t.integer "active_time" t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false t.boolean "deleted" - t.integer "user_id" - t.boolean "is_log" - t.float "rating" - t.text "step_text" + t.text "description" t.boolean "is_ingredient" + t.boolean "is_log" + t.string "name" + t.float "rating" + t.text "source" + t.text "step_text" + t.integer "total_time" + t.datetime "updated_at", precision: nil, null: false + t.integer "user_id" + t.string "yields" end create_table "recipes_tags", id: false, force: :cascade do |t| @@ -121,94 +121,94 @@ ActiveRecord::Schema[7.2].define(version: 2018_09_15_134841) do end create_table "tags", force: :cascade do |t| - t.string "name" - t.string "lowercase_name" t.datetime "created_at", precision: nil, null: false + t.string "lowercase_name" + t.string "name" t.datetime "updated_at", precision: nil, null: false t.index ["lowercase_name"], name: "index_tags_on_lowercase_name", unique: true end create_table "task_items", force: :cascade do |t| - t.integer "task_list_id", null: false + t.boolean "completed" + t.datetime "created_at", precision: nil, null: false t.string "name" t.string "quantity" - t.datetime "created_at", precision: nil, null: false + t.integer "task_list_id", null: false t.datetime "updated_at", precision: nil, null: false - t.boolean "completed" t.index ["task_list_id"], name: "index_task_items_on_task_list_id" end create_table "task_lists", force: :cascade do |t| - t.integer "user_id", null: false - t.string "name" t.datetime "created_at", precision: nil, null: false + t.string "name" t.datetime "updated_at", precision: nil, null: false + t.integer "user_id", null: false t.index ["user_id"], name: "index_task_lists_on_user_id" end create_table "usda_food_weights", force: :cascade do |t| - t.integer "usda_food_id", null: false t.decimal "amount", precision: 7, scale: 3 + t.datetime "created_at", precision: nil, null: false t.string "description" t.decimal "gram_weight", precision: 7, scale: 1 - t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false + t.integer "usda_food_id", null: false t.index ["usda_food_id"], name: "index_usda_food_weights_on_usda_food_id" end create_table "usda_foods", force: :cascade do |t| - t.string "ndbn", limit: 25 - t.string "long_description" - t.string "short_description" - t.decimal "water", precision: 10, scale: 2 - t.integer "kcal" - t.decimal "protein", precision: 10, scale: 2 - t.decimal "lipid", precision: 10, scale: 2 t.decimal "ash", precision: 10, scale: 2 + t.integer "calcium" t.decimal "carbohydrates", precision: 10, scale: 2 + t.decimal "cholesterol", precision: 10, scale: 3 + t.decimal "copper", precision: 10, scale: 3 + t.datetime "created_at", precision: nil, null: false t.decimal "fiber", precision: 10, scale: 1 - t.decimal "sugar", precision: 10, scale: 2 t.decimal "gram_weight_1", precision: 9, scale: 2 t.decimal "gram_weight_2", precision: 9, scale: 2 t.string "gram_weight_desc_1" t.string "gram_weight_desc_2" + t.text "ingredients" + t.decimal "iron", precision: 10, scale: 2 + t.integer "kcal" + t.decimal "lipid", precision: 10, scale: 2 + t.string "long_description" + t.integer "magnesium" + t.decimal "manganese", precision: 10, scale: 3 + t.string "manufacturer" + t.string "ndbn", limit: 25 + t.string "nutrient_unit" + t.integer "phosphorus" + t.integer "potassium" + t.decimal "protein", precision: 10, scale: 2 t.string "refuse_description" t.integer "refuse_percent" t.string "scientific_name" - t.datetime "created_at", precision: nil, null: false - t.datetime "updated_at", precision: nil, null: false - t.integer "calcium" - t.decimal "iron", precision: 10, scale: 2 - t.integer "magnesium" - t.integer "phosphorus" - t.integer "potassium" + t.string "short_description" t.integer "sodium" - t.decimal "zinc", precision: 10, scale: 2 - t.decimal "copper", precision: 10, scale: 3 - t.decimal "manganese", precision: 10, scale: 3 - t.decimal "vit_c", precision: 10, scale: 1 - t.decimal "vit_b6", precision: 10, scale: 3 - t.decimal "vit_b12", precision: 10, scale: 2 - t.integer "vit_a" - t.decimal "vit_e", precision: 10, scale: 2 - t.decimal "vit_d", precision: 10, scale: 1 - t.decimal "vit_k", precision: 10, scale: 1 - t.decimal "cholesterol", precision: 10, scale: 3 t.string "source" - t.string "manufacturer" - t.text "ingredients" - t.string "nutrient_unit" + t.decimal "sugar", precision: 10, scale: 2 + t.datetime "updated_at", precision: nil, null: false + t.integer "vit_a" + t.decimal "vit_b12", precision: 10, scale: 2 + t.decimal "vit_b6", precision: 10, scale: 3 + t.decimal "vit_c", precision: 10, scale: 1 + t.decimal "vit_d", precision: 10, scale: 1 + t.decimal "vit_e", precision: 10, scale: 2 + t.decimal "vit_k", precision: 10, scale: 1 + t.decimal "water", precision: 10, scale: 2 + t.decimal "zinc", precision: 10, scale: 2 t.index ["long_description"], name: "index_usda_foods_on_long_description" t.index ["ndbn"], name: "index_usda_foods_on_ndbn" end create_table "users", force: :cascade do |t| - t.string "username" + t.boolean "admin" + t.datetime "created_at", precision: nil, null: false t.string "email" t.string "full_name" t.string "password_digest" - t.boolean "admin" - t.datetime "created_at", precision: nil, null: false t.datetime "updated_at", precision: nil, null: false + t.string "username" end end