This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ heroku run rails db:migrate | |
| › Warning: heroku update available from 7.47.11 to | |
| › 7.50.0. | |
| Running rails db:migrate on ⬢ tangotube... up, run.3794 (Hobby) | |
| =========================================== | |
| DEPRECATION: The cocaine gem is deprecated. Please upgrade to terrapin. See https://github.com/thoughtbot/terrapin/ for further instructions. | |
| =========================================== | |
| W, [2021-03-12T17:30:56.372779 #4] WARN -- : Creating scope :has_youtube_song. Overwriting existing method Video.has_youtube_song. | |
| D, [2021-03-12T17:30:56.663890 #4] DEBUG -- : (1.9ms) SELECT pg_try_advisory_lock(3765850433595939465) | |
| D, [2021-03-12T17:30:56.697383 #4] DEBUG -- : (2.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CreateInitialSchema < ActiveRecord::Migration[6.1] | |
| def up | |
| statements = <<-eos | |
| SET statement_timeout = 0; | |
| SET lock_timeout = 0; | |
| SET idle_in_transaction_session_timeout = 0; | |
| SET client_encoding = 'UTF8'; | |
| SET standard_conforming_strings = on; | |
| SELECT pg_catalog.set_config('search_path', '', false); | |
| SET check_function_bodies = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ rails db:migrate | |
| =========================================== | |
| DEPRECATION: The cocaine gem is deprecated. Please upgrade to terrapin. See https://github.com/thoughtbot/terrapin/ for further instructions. | |
| =========================================== | |
| == 1 CreateInitialSchema: migrating =========================================== | |
| -- execute("SET statement_timeout = 0") | |
| -> 0.0021s | |
| -- execute("SET lock_timeout = 0") | |
| -> 0.0008s | |
| -- execute("SET idle_in_transaction_session_timeout = 0") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ➜ heroku run rails db:migrate | |
| › Warning: heroku update available from 7.47.11 to 7.50.0. | |
| Running rails db:migrate on ⬢ tangotube... up, run.7117 (Hobby) | |
| =========================================== | |
| DEPRECATION: The cocaine gem is deprecated. Please upgrade to terrapin. See https://github.com/thoughtbot/terrapin/ for further instructions. | |
| =========================================== | |
| W, [2021-03-16T11:00:38.916636 #4] WARN -- : Creating scope :has_youtube_song. Overwriting existing method Video.has_youtube_song. | |
| D, [2021-03-16T11:00:39.106652 #4] DEBUG -- : (0.8ms) SELECT pg_try_advisory_lock(3765850433595939465) | |
| D, [2021-03-16T11:00:39.121737 #4] DEBUG -- : (1.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC | |
| I, [2021-03-16T11:00:39.123560 #4] INFO -- : Migrating to CreateInitialSchema (0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Video::Display | |
| def initialize(video) | |
| @video = video | |
| end | |
| def display | |
| @display ||= Video::Display.new(self) | |
| end | |
| def any_song_attributes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Channel < ApplicationRecord | |
| include Reviewable | |
| include Importable | |
| has_many :videos, dependent: :destroy | |
| validates :channel_id, presence: true, uniqueness: true | |
| before_save :update_imported, if: :count_changed? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Video::YoutubeImport::Playlist | |
| class << self | |
| def import(playlist_id) | |
| new(playlist_id).import | |
| end | |
| def import_videos(playlist_id) | |
| new(playlist_id).import_videos | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Video::YoutubeImport::Video | |
| class << self | |
| def import(youtube_id) | |
| new(youtube_id).import | |
| end | |
| end | |
| def initialize(youtube_id) | |
| @youtube_video = fetch_by_id(youtube_id) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Video::YoutubeImport::Playlist | |
| class << self | |
| def import(playlist_id) | |
| new(playlist_id).import | |
| end | |
| def import_videos(playlist_id) | |
| new(playlist_id).import_videos | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="filter-item"> | |
| <label> | |
| <%= title.to_s.titleize %> | |
| </label> | |
| <%= select_tag title.to_s, | |
| options_for_select(model, params[title].presence), include_blank: true, multiple: false, | |
| data: { action: "filter#filter", | |
| "filter-target": "filter", | |
| controller:'slimselect' | |
| }, |