Skip to content

Commit

Permalink
chore: cleanup after #20
Browse files Browse the repository at this point in the history
  • Loading branch information
ElMassimo committed Aug 23, 2024
1 parent 7a926e7 commit 6eb9495
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module.exports = {
extends: ['@antfu/eslint-config'],
rules: {
'@typescript-eslint/space-before-function-paren': ['warn', 'always'],
'@typescript-eslint/quotes': 'off',
'vue/attribute-hyphenation': ['warn', 'never'],
'vue/html-closing-bracket-spacing': ['warn', {
startTag: 'never',
Expand Down
4 changes: 3 additions & 1 deletion playground/vanilla/app/frontend/types/serializers/Song.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// TypesFromSerializers CacheKey c3af64a41d21e71dfae56644517994e1
// TypesFromSerializers CacheKey 460b4a83a2e81c9d693ac5490f9e0b76
//
// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers.
import type Composer from './Composer'

export default interface Song {
id: number
composer: Composer
genre: "disco" | "rock" | "classical"
tempo: "slow" | "medium" | "fast"
title?: string
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// TypesFromSerializers CacheKey 6774f7cbf07614cf9b4136fbd0c8b441
// TypesFromSerializers CacheKey 3aa811bd4673913bbd09f2967979b304
//
// DO NOT MODIFY: This file was automatically generated by TypesFromSerializers.
import type Composer from './Composer'
Expand All @@ -7,6 +7,8 @@ import type Video from './Video'
export default interface SongWithVideos {
id: number
composer: Composer
genre: "disco" | "rock" | "classical"
tempo: "slow" | "medium" | "fast"
title?: string
videos: Video[]
}
2 changes: 1 addition & 1 deletion playground/vanilla/app/models/song.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ class Song < ApplicationRecord
belongs_to :composer
has_many :video_clips

enum genre: { disco: "disco", rock: "rock", classical: "classical" }
enum genre: {fingerstyle: "fingerstyle", rock: "rock", classical: "classical"}
enum tempo: %w[slow medium fast]
end

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
class AddEnumsToSongs < ActiveRecord::Migration[6.0]
def change
add_column :songs, :genre, :string, null: false
add_column :songs, :tempo, :integer, null: true
end
end
5 changes: 2 additions & 3 deletions playground/vanilla/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,20 @@
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_02_27_112250) do

create_table "composers", force: :cascade do |t|
t.text "first_name"
t.text "last_name"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "genre", null: false
t.integer "tempo"
end

create_table "songs", force: :cascade do |t|
t.text "title"
t.integer "composer_id"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.string "genre", null: false
t.integer "tempo"
t.index ["composer_id"], name: "index_songs_on_composer_id"
end

Expand Down
22 changes: 11 additions & 11 deletions playground/vanilla/db/seeds.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
jorge_cardoso = Composer.create!(first_name: "Jorge", last_name: "Cardoso")
domingos_semenzato = Composer.create!(first_name: "Domingos", last_name: "Semenzato")

smoke_signals = Song.create(title: "Smoke Signals", composer: dylan_ryche)
camino_libre = Song.create(title: "Camino Libre", composer: maximo_mussini)
sin_querer = Song.create(title: "Sin Querer", composer: leon_gieco)
tabula_rasa = Song.create(title: "Tabula Rasa", composer: calum_graham)
raindance = Song.create(title: "Raindance", composer: matteo_brenci)
ragamuffin = Song.create(title: "Ragamuffin", composer: michael_hedges)
vals_venezolano_n_2 = Song.create(title: "Vals Venezolano Nº 2", composer: antonio_lauro)
xaranga_do_vovo = Song.create(title: "Xaranga do Vovô", composer: celso_machado)
cafe_1930 = Song.create(title: "Café 1930", composer: astor_piazzolla)
milonga_uruguay = Song.create(title: "Milonga (Uruguay)", composer: jorge_cardoso)
divagando = Song.create(title: "Divagando", composer: domingos_semenzato)
smoke_signals = Song.create(title: "Smoke Signals", composer: dylan_ryche, genre: "fingerstyle")
camino_libre = Song.create(title: "Camino Libre", composer: maximo_mussini, genre: "fingerstyle")
sin_querer = Song.create(title: "Sin Querer", composer: leon_gieco, genre: "fingerstyle")
tabula_rasa = Song.create(title: "Tabula Rasa", composer: calum_graham, genre: "fingerstyle")
raindance = Song.create(title: "Raindance", composer: matteo_brenci, genre: "fingerstyle")
ragamuffin = Song.create(title: "Ragamuffin", composer: michael_hedges, genre: "fingerstyle")
vals_venezolano_n_2 = Song.create(title: "Vals Venezolano Nº 2", composer: antonio_lauro, genre: "classical")
xaranga_do_vovo = Song.create(title: "Xaranga do Vovô", composer: celso_machado, genre: "classical")
cafe_1930 = Song.create(title: "Café 1930", composer: astor_piazzolla, genre: "classical")
milonga_uruguay = Song.create(title: "Milonga (Uruguay)", composer: jorge_cardoso, genre: "classical")
divagando = Song.create(title: "Divagando", composer: domingos_semenzato, genre: "classical")

VideoClip.create!(id: 11, song: smoke_signals, youtube_id: "3glhadBFKGc", title: "Máximo Mussini interpreta \"Smoke Signals\" por Dylan Ryche")
VideoClip.create!(id: 10, song: camino_libre, youtube_id: "7cUCxXuBk_8", title: "\"Camino Libre\" by Máximo Mussini")
Expand Down

0 comments on commit 6eb9495

Please sign in to comment.