From 9d0a99173338538c6a674998d629f98c10d20eb4 Mon Sep 17 00:00:00 2001 From: Kabiru Mwenja Date: Mon, 23 Dec 2024 20:49:05 +0300 Subject: [PATCH] Fix unknown attribute 'parent_category' for Category in demo generator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ```ruby ❯ bin/rails demo_data:reset user reset bin/rails aborted! ActiveModel::UnknownAttributeError: unknown attribute 'parent_category' for Category. (ActiveModel::UnknownAttributeError) raise UnknownAttributeError.new(self, k.to_s) ``` Follows: https://github.com/maybe-finance/maybe/pull/1561 --- app/models/demo/generator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/demo/generator.rb b/app/models/demo/generator.rb index d26b85c7783..8041dea6f58 100644 --- a/app/models/demo/generator.rb +++ b/app/models/demo/generator.rb @@ -92,9 +92,9 @@ def create_categories! end food = family.categories.find_by(name: "Food & Drink") - family.categories.create!(name: "Restaurants", parent_category: food) - family.categories.create!(name: "Groceries", parent_category: food) - family.categories.create!(name: "Alcohol & Bars", parent_category: food) + family.categories.create!(name: "Restaurants", parent: food) + family.categories.create!(name: "Groceries", parent: food) + family.categories.create!(name: "Alcohol & Bars", parent: food) end def create_merchants!