Skip to content

Instantly share code, notes, and snippets.

View justinallenmarsh's full-sized avatar
🤓
Programming

Justin Marsh justinallenmarsh

🤓
Programming
View GitHub Profile
➜ 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
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;
➜ 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")
@justinallenmarsh
justinallenmarsh / Heroku Logs
Created March 16, 2021 11:01
This is the server response after running `heroku run rails db:migrate`
➜ 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)
class Video::Display
def initialize(video)
@video = video
end
def display
@display ||= Video::Display.new(self)
end
def any_song_attributes
@justinallenmarsh
justinallenmarsh / channel.rb
Last active March 27, 2021 20:08
First doubles test
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?
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
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
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
<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'
},