Remove image_* columns from asciicasts

ex-upload
Marcin Kulik 7 years ago
parent 8703a32111
commit cac9aea574

@ -47,8 +47,7 @@ module AsciicastsHelper
def embed_html_link(asciicast)
img_src = asciicast_url(asciicast, format: :png)
url = asciicast_url(asciicast)
width = %{width="#{asciicast.image_width}"} if asciicast.image_width
%(<a href="#{url}" target="_blank"><img src="#{img_src}" #{width}/></a>)
%(<a href="#{url}" target="_blank"><img src="#{img_src}" /></a>)
end
def embed_markdown_link(asciicast)

@ -8,7 +8,6 @@ class Asciicast < ActiveRecord::Base
mount_uploader :stdout_timing, StdoutTimingUploader
mount_uploader :stdout_frames, StdoutFramesUploader
mount_uploader :file, AsciicastUploader
mount_uploader :image, ImageUploader
serialize :snapshot, ActiveSupportJsonProxy
@ -151,12 +150,6 @@ class Asciicast < ActiveRecord::Base
end
end
def image_hash
version = 2 # version of screenshot, increment to force regeneration
input = "#{version}/#{id}/#{snapshot_at}"
Digest::SHA1.hexdigest(input)
end
def generate_secret_token
begin
self.secret_token = self.class.generate_secret_token

@ -1,2 +0,0 @@
class ImageUploader < BaseUploader
end

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20170215120234) do
ActiveRecord::Schema.define(version: 20170607190249) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -56,9 +56,6 @@ ActiveRecord::Schema.define(version: 20170215120234) do
t.float "snapshot_at"
t.integer "version", null: false
t.string "file"
t.string "image"
t.integer "image_width"
t.integer "image_height"
t.string "secret_token", null: false
t.boolean "private", default: false, null: false
end

Loading…
Cancel
Save