Skip to content

Commit

Permalink
Update README.adoc
Browse files Browse the repository at this point in the history
Updates the enum to show syntax that was introduced in Rails 7.
  • Loading branch information
crespire authored Dec 9, 2024
1 parent b077bc2 commit 6a35199
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -430,10 +430,10 @@ lead to broken code.
----
class Transaction < ApplicationRecord
# bad - implicit values - ordering matters
enum type: %i[credit debit]
enum :type, %i[credit debit]
# good - explicit values - ordering does not matter
enum type: {
enum :type, {
credit: 0,
debit: 1
}
Expand Down

0 comments on commit 6a35199

Please sign in to comment.