Skip to content

Commit

Permalink
Fix unknown attribute 'parent_category' for Category in demo generator
Browse files Browse the repository at this point in the history
```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: #1561
  • Loading branch information
akabiru committed Dec 23, 2024
1 parent 77def1d commit 9d0a991
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/demo/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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!
Expand Down

0 comments on commit 9d0a991

Please sign in to comment.