We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7e62cdc commit f71b97dCopy full SHA for f71b97d
playground/vanilla/app/models/song.rb
@@ -2,6 +2,11 @@ class Song < ApplicationRecord
2
belongs_to :composer
3
has_many :video_clips
4
5
- enum genre: {fingerstyle: "fingerstyle", rock: "rock", classical: "classical"}
6
- enum tempo: %w[slow medium fast]
+ if Rails::VERSION::MAJOR >= 7
+ enum :genre, fingerstyle: "fingerstyle", rock: "rock", classical: "classical"
7
+ enum :tempo, %w[slow medium fast]
8
+ else
9
+ enum genre: {fingerstyle: "fingerstyle", rock: "rock", classical: "classical"}
10
+ enum tempo: %w[slow medium fast]
11
+ end
12
end
0 commit comments