Skip to content

Commit 22083a7

Browse files
Fix class inheritance
While going through the getting started tutorial to learn rails, I copied the code block which was missing inheritance of ApplicationRecord, which broke the application. Hopefully this can save future beginners some time!
1 parent 6a47039 commit 22083a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

guides/source/getting_started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,7 @@ Now, let's add a rich text description field to our product.
17381738
First, add the following to the `Product` model:
17391739

17401740
```ruby#2
1741-
class Product
1741+
class Product < ApplicationRecord
17421742
has_rich_text :description
17431743
validates :name, presence: true
17441744
end
@@ -1806,7 +1806,7 @@ We can also use Active Storage directly. Let's add a featured image to the
18061806
`Product` model.
18071807

18081808
```ruby#2
1809-
class Product
1809+
class Product < ApplicationRecord
18101810
has_one_attached :featured_image
18111811
has_rich_text :description
18121812
validates :name, presence: true

0 commit comments

Comments
 (0)