zencodable 0.1.0 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -26,13 +26,15 @@ _developed on ruby 1.9.2-p290 and Rails 3.1.3_
26
26
  3. this gem (zencodable) in your gemfile, and typhoeus.
27
27
 
28
28
  gem 'zencodable'
29
- gem 'typhoeus'
29
+ gem 'typhoeus' # NOTE: for heroku deploys, pin to 0.2.4 https://github.com/dbalatero/typhoeus/issues/123
30
30
 
31
31
  # Setup
32
32
 
33
- ## Zencoder API keys
33
+ ## Zencoder API keys and initializer settings
34
34
 
35
- the zencoder/zencoder-rb gem expects access to your Zencoder API keys in some fashion. Also, we need to use dbalatero/typhoeus for HTTP stuffs, that's the only way Zencoder will work with S3. So, I like something in `config/initializers` like
35
+ the [zencoder](https://github.com/zencoder/zencoder-rb) gem expects access to your Zencoder API keys in some fashion. Also, [typhoeus](https://github.com/dbalatero/typhoeus) is a big improvement for HTTP stuffs. Thirdly, Zencoder's API v2 (soon to be released as of 2011-12-4) is full of options, has more progress information and much more hotness - so let's use that!.
36
+
37
+ So, I like something in `config/initializers/zencoder.rb` like
36
38
 
37
39
  # zencoder setup
38
40
  if Rails.env == 'production'
@@ -43,6 +45,8 @@ the zencoder/zencoder-rb gem expects access to your Zencoder API keys in some fa
43
45
 
44
46
  Zencoder::HTTP.http_backend = Zencoder::HTTP::Typhoeus
45
47
 
48
+ Zencoder.base_url = 'https://app.zencoder.com/api/v2'
49
+
46
50
  ## Bucket policy
47
51
 
48
52
  The bucket needs to have a custom policy to allow Zencoder to place the output videos on it. [Here is a guide on Zencoder's site, follow it](https://app.zencoder.com/docs/guides/getting-started/working-with-s3)
@@ -71,7 +75,7 @@ add something like the above `has_video_encodings` class method to your model (t
71
75
 
72
76
  The options should include a `:s3_config` key that gives a location of a YAML file containing your S3 credentials, which should contain a 'bucket' key (you already have one, right?) Actually, all we need from that is the bucket name, so you can instead use a `:bucket` key to give the name of the bucket where the output files should be placed.
73
77
 
74
- The `:path` option can be any path within that bucket. It can contain a `:basename` token, which will be replaced with a sanitized, URL-encoded version of the original filename as uploaded.
78
+ The `:path` option can be any path within that bucket. It can contain a `:basename` token, which will be replaced with a sanitized, URL-encoded version of the original filename as uploaded.
75
79
 
76
80
  `:formats` is a list of output formats you'd like. [Supported formats and codecs](https://app.zencoder.com/docs/api/encoding/format-and-codecs/format)
77
81
 
@@ -79,7 +83,7 @@ The other options are all those that can be handled by Zencoder. More info can b
79
83
 
80
84
  ### Give it a source URL
81
85
 
82
- All that's needed to trigger the Zencoder job is to change the `origin_url` value of your model, and then save. That will be picked up, sent to Zencoder, and your job will be started with your desired settings.
86
+ All that's needed to trigger the Zencoder job is to change the `origin_url` value of your model, and then save. That will be picked up, sent to Zencoder, and your job will be started with your desired settings.
83
87
 
84
88
  As the job runs, you can check `Model.job_status` as you see fit, if the job is neither failed nor finished, it will request an update from Zencoder for that Job.
85
89
 
@@ -89,22 +93,26 @@ Individual files will complete at different times, so you can also check the `st
89
93
  vid.origin_url = 'http://sourcebucket.s3.amazonaws.com/largevideos/funny_kittehs[HD].mov'
90
94
  vid.save
91
95
  vid.job_status # "new"
92
- ...
96
+ ...
93
97
  vid.job_status # "waiting"
94
- ...
98
+ ...
95
99
  vid.job_status # "processing"
96
100
  vid.video_encoded_files.collect { |v| [v.format, v.state] }
97
- ...
101
+ ...
98
102
  vid.job_status # "finished"
99
103
  vid.video_encoded_files.size # 4
100
104
  vid.video_encoded_file_thumbnails.size # 2
101
-
105
+
102
106
 
103
107
  ## TODO
104
108
 
105
- * change name of `origin_url` column and make sure its added in the migrations
106
109
  * rake task to generate a working bucket policy (even if it has to be pasted in)
110
+ * set timeouts on update_job
111
+ * create DJ and/or Resque workers to handle job submission (should be optional dependencies though)
112
+ * generator to install config/initializer
113
+ * remove files from S3 when object is deleted
107
114
  * background jobs to update the ZC job progress, with events/notifications
115
+ * use API v2 features to get more interesting info on job progress
108
116
  * is s3_url basename sanitization going to be good for non-ASCII filenames? no.
109
117
 
110
118
  ## License
@@ -24,11 +24,7 @@ module Zencodable
24
24
  end
25
25
 
26
26
  def create_migration_files
27
- migration_template 'add_zencoder_job_tracking_columns.rb', "db/migrate/add_zencoder_job_tracking_columns_to_#{name.tableize}"
28
- migration_template 'create_association_table.rb', "db/migrate/create_#{association_name}"
29
- unless options.skip_thumbnails?
30
- migration_template 'create_association_thumbnails_table.rb', "db/migrate/create_#{association_name}_thumbnails"
31
- end
27
+ migration_template 'zencodable_add_tracking_columns_and_tables.rb', "db/migrate/zencodable_add_tracking_columns_and_tables"
32
28
  end
33
29
 
34
30
  end
@@ -0,0 +1,33 @@
1
+ class AddZencoderJobTrackingColumns < ActiveRecord::Migration
2
+ def change
3
+ add_column :<%= name.tableize %>, :origin_url, :string
4
+ add_column :<%= name.tableize %>, :zencoder_job_status, :string
5
+ add_column :<%= name.tableize %>, :zencoder_job_created, :datetime
6
+ add_column :<%= name.tableize %>, :zencoder_job_finished, :datetime
7
+
8
+ create_table "<%= association_name %>" do |t|
9
+ t.string "url"
10
+ t.string "format"
11
+ t.integer "zencoder_file_id"
12
+ t.integer "<%= name.foreign_key %>"
13
+ t.datetime "created_at"
14
+ t.integer "width"
15
+ t.integer "height"
16
+ t.integer "file_size"
17
+ t.string "error_message"
18
+ t.string "state"
19
+ t.timestamps
20
+ end
21
+
22
+ <% if !options.skip_thumbnails %>
23
+ create_table "<%= association_name.singularize %>_thumbnails" do |t|
24
+ t.string "thumbnail_file_name"
25
+ t.string "thumbnail_content_type"
26
+ t.integer "thumbnail_file_size"
27
+ t.datetime "thumbnail_updated_at"
28
+ t.integer "<%= name.foreign_key %>"
29
+ t.timestamps
30
+ end
31
+ <% end %>
32
+ end
33
+ end
@@ -1,3 +1,3 @@
1
1
  module Zencodable
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
data/test/debug.log CHANGED
@@ -901,3 +901,357 @@ Unfinished job found. Updating details.
901
901
   (0.0ms) SAVEPOINT active_record_1
902
902
   (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-02 21:23:00.609743' WHERE "videos"."id" = 1
903
903
   (0.1ms) RELEASE SAVEPOINT active_record_1
904
+  (0.1ms) SAVEPOINT active_record_1
905
+ SQL (17.2ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
906
+  (0.1ms) RELEASE SAVEPOINT active_record_1
907
+  (0.0ms) SAVEPOINT active_record_1
908
+ Origin URL changed. Creating new ZenCoder job.
909
+ ZenCoder job created, ID = 123
910
+  (0.2ms) UPDATE "videos" SET "origin_url" = 'http://foo.com/1/2/4', "zencoder_job_id" = '123', "zencoder_job_status" = 'new', "zencoder_job_created" = '2011-12-02 21:47:37.303304', "updated_at" = '2011-12-02 21:47:37.303528' WHERE "videos"."id" = 1
911
+  (0.1ms) RELEASE SAVEPOINT active_record_1
912
+  (0.0ms) SAVEPOINT active_record_1
913
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "finished"]]
914
+  (0.1ms) RELEASE SAVEPOINT active_record_1
915
+  (0.0ms) SAVEPOINT active_record_1
916
+ SQL (1.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
917
+  (0.1ms) RELEASE SAVEPOINT active_record_1
918
+  (0.1ms) SAVEPOINT active_record_1
919
+ SQL (0.6ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["duration_sec", 120], ["error_message", nil], ["file_size", 19293819], ["format", "webm"], ["height", 600], ["state", "finished"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["url", "http://parallaxp.s3.amazonaws.com/videos/zc/video-title/file.1.off"], ["video_id", 1], ["width", 800], ["zencoder_file_id", 12345329]]
920
+  (0.1ms) RELEASE SAVEPOINT active_record_1
921
+ VideoFile Load (0.2ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1 AND "video_files"."format" = 'webm' LIMIT 1
922
+  (0.1ms) SAVEPOINT active_record_1
923
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "new"]]
924
+  (0.1ms) RELEASE SAVEPOINT active_record_1
925
+ Unfinished job found. Updating details.
926
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
927
+  (0.0ms) SAVEPOINT active_record_1
928
+  (0.0ms) RELEASE SAVEPOINT active_record_1
929
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
930
+  (0.0ms) SAVEPOINT active_record_1
931
+  (0.0ms) RELEASE SAVEPOINT active_record_1
932
+  (0.0ms) SAVEPOINT active_record_1
933
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'makin progress', "updated_at" = '2011-12-02 21:47:37.468334' WHERE "videos"."id" = 1
934
+  (0.1ms) RELEASE SAVEPOINT active_record_1
935
+  (0.0ms) SAVEPOINT active_record_1
936
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
937
+  (0.1ms) RELEASE SAVEPOINT active_record_1
938
+ Unfinished job found. Updating details.
939
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
940
+  (0.0ms) SAVEPOINT active_record_1
941
+ SQL (1.1ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["duration_sec", nil], ["error_message", nil], ["file_size", nil], ["format", "flv"], ["height", nil], ["state", nil], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["url", "http://s3.com/6/7/8.flv"], ["video_id", 1], ["width", nil], ["zencoder_file_id", nil]]
942
+  (0.1ms) RELEASE SAVEPOINT active_record_1
943
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
944
+  (0.0ms) SAVEPOINT active_record_1
945
+  (0.0ms) RELEASE SAVEPOINT active_record_1
946
+  (0.0ms) SAVEPOINT active_record_1
947
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-02 21:47:37.481324' WHERE "videos"."id" = 1
948
+  (0.1ms) RELEASE SAVEPOINT active_record_1
949
+  (0.0ms) SAVEPOINT active_record_1
950
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
951
+  (0.1ms) RELEASE SAVEPOINT active_record_1
952
+ Unfinished job found. Updating details.
953
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
954
+  (0.0ms) SAVEPOINT active_record_1
955
+  (0.0ms) RELEASE SAVEPOINT active_record_1
956
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
957
+  (0.0ms) SAVEPOINT active_record_1
958
+ SQL (0.7ms) INSERT INTO "video_file_thumbnails" ("created_at", "thumbnail_content_type", "thumbnail_file_name", "thumbnail_file_size", "thumbnail_updated_at", "updated_at", "video_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["thumbnail_content_type", "png"], ["thumbnail_file_name", "http://s3.com/1/2/3.png"], ["thumbnail_file_size", nil], ["thumbnail_updated_at", nil], ["updated_at", Fri, 02 Dec 2011 21:47:37 UTC +00:00], ["video_id", 1]]
959
+  (0.1ms) RELEASE SAVEPOINT active_record_1
960
+  (0.0ms) SAVEPOINT active_record_1
961
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-02 21:47:37.502119' WHERE "videos"."id" = 1
962
+  (0.1ms) RELEASE SAVEPOINT active_record_1
963
+  (0.1ms) SAVEPOINT active_record_1
964
+ SQL (47.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
965
+  (0.1ms) RELEASE SAVEPOINT active_record_1
966
+  (0.0ms) SAVEPOINT active_record_1
967
+ Origin URL changed. Creating new ZenCoder job.
968
+ ZenCoder job created, ID = 123
969
+  (0.2ms) UPDATE "videos" SET "origin_url" = 'http://foo.com/1/2/4', "zencoder_job_id" = '123', "zencoder_job_status" = 'new', "zencoder_job_created" = '2011-12-02 21:48:06.791811', "updated_at" = '2011-12-02 21:48:06.792022' WHERE "videos"."id" = 1
970
+  (0.1ms) RELEASE SAVEPOINT active_record_1
971
+  (0.1ms) SAVEPOINT active_record_1
972
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "finished"]]
973
+  (0.1ms) RELEASE SAVEPOINT active_record_1
974
+  (0.0ms) SAVEPOINT active_record_1
975
+ SQL (1.2ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
976
+  (0.1ms) RELEASE SAVEPOINT active_record_1
977
+  (0.1ms) SAVEPOINT active_record_1
978
+ SQL (0.6ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["duration_sec", 120], ["error_message", nil], ["file_size", 19293819], ["format", "webm"], ["height", 600], ["state", "finished"], ["updated_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["url", "http://parallaxp.s3.amazonaws.com/videos/zc/video-title/file.1.off"], ["video_id", 1], ["width", 800], ["zencoder_file_id", 12345329]]
979
+  (0.1ms) RELEASE SAVEPOINT active_record_1
980
+ VideoFile Load (0.2ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1 AND "video_files"."format" = 'webm' LIMIT 1
981
+  (0.0ms) SAVEPOINT active_record_1
982
+ SQL (1.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "new"]]
983
+  (0.1ms) RELEASE SAVEPOINT active_record_1
984
+ Unfinished job found. Updating details.
985
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
986
+  (0.0ms) SAVEPOINT active_record_1
987
+  (0.0ms) RELEASE SAVEPOINT active_record_1
988
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
989
+  (0.0ms) SAVEPOINT active_record_1
990
+  (0.0ms) RELEASE SAVEPOINT active_record_1
991
+  (0.4ms) SAVEPOINT active_record_1
992
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'makin progress', "updated_at" = '2011-12-02 21:48:06.995664' WHERE "videos"."id" = 1
993
+  (0.1ms) RELEASE SAVEPOINT active_record_1
994
+  (0.0ms) SAVEPOINT active_record_1
995
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:48:06 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
996
+  (0.1ms) RELEASE SAVEPOINT active_record_1
997
+ Unfinished job found. Updating details.
998
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
999
+  (0.0ms) SAVEPOINT active_record_1
1000
+ SQL (1.0ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:07 UTC +00:00], ["duration_sec", nil], ["error_message", nil], ["file_size", nil], ["format", "flv"], ["height", nil], ["state", nil], ["updated_at", Fri, 02 Dec 2011 21:48:07 UTC +00:00], ["url", "http://s3.com/6/7/8.flv"], ["video_id", 1], ["width", nil], ["zencoder_file_id", nil]]
1001
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1002
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1003
+  (0.0ms) SAVEPOINT active_record_1
1004
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1005
+  (0.0ms) SAVEPOINT active_record_1
1006
+  (0.3ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-02 21:48:07.006681' WHERE "videos"."id" = 1
1007
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1008
+  (0.0ms) SAVEPOINT active_record_1
1009
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:07 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Fri, 02 Dec 2011 21:48:07 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1010
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1011
+ Unfinished job found. Updating details.
1012
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1013
+  (0.0ms) SAVEPOINT active_record_1
1014
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1015
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1016
+  (0.0ms) SAVEPOINT active_record_1
1017
+ SQL (0.8ms) INSERT INTO "video_file_thumbnails" ("created_at", "thumbnail_content_type", "thumbnail_file_name", "thumbnail_file_size", "thumbnail_updated_at", "updated_at", "video_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Fri, 02 Dec 2011 21:48:07 UTC +00:00], ["thumbnail_content_type", "png"], ["thumbnail_file_name", "http://s3.com/1/2/3.png"], ["thumbnail_file_size", nil], ["thumbnail_updated_at", nil], ["updated_at", Fri, 02 Dec 2011 21:48:07 UTC +00:00], ["video_id", 1]]
1018
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1019
+  (0.0ms) SAVEPOINT active_record_1
1020
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-02 21:48:07.027814' WHERE "videos"."id" = 1
1021
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1022
+  (0.1ms) SAVEPOINT active_record_1
1023
+ SQL (74.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1024
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1025
+  (0.0ms) SAVEPOINT active_record_1
1026
+ Origin URL changed. Creating new ZenCoder job.
1027
+ ZenCoder job created, ID = 123
1028
+  (0.2ms) UPDATE "videos" SET "origin_url" = 'http://foo.com/1/2/4', "zencoder_job_id" = '123', "zencoder_job_status" = 'new', "zencoder_job_created" = '2011-12-05 19:17:23.313278', "updated_at" = '2011-12-05 19:17:23.313506' WHERE "videos"."id" = 1
1029
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1030
+  (0.1ms) SAVEPOINT active_record_1
1031
+ SQL (2.4ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "finished"]]
1032
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1033
+  (0.0ms) SAVEPOINT active_record_1
1034
+ SQL (1.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1035
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1036
+  (0.1ms) SAVEPOINT active_record_1
1037
+ SQL (0.6ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["duration_sec", 120], ["error_message", nil], ["file_size", 19293819], ["format", "webm"], ["height", 600], ["state", "finished"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["url", "http://parallaxp.s3.amazonaws.com/videos/zc/video-title/file.1.off"], ["video_id", 1], ["width", 800], ["zencoder_file_id", 12345329]]
1038
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1039
+ VideoFile Load (0.2ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1 AND "video_files"."format" = 'webm' LIMIT 1
1040
+  (0.1ms) SAVEPOINT active_record_1
1041
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "new"]]
1042
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1043
+ Unfinished job found. Updating details.
1044
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1045
+  (0.0ms) SAVEPOINT active_record_1
1046
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1047
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1048
+  (0.0ms) SAVEPOINT active_record_1
1049
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1050
+  (0.0ms) SAVEPOINT active_record_1
1051
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'makin progress', "updated_at" = '2011-12-05 19:17:23.517874' WHERE "videos"."id" = 1
1052
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1053
+  (0.1ms) SAVEPOINT active_record_1
1054
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1055
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1056
+ Unfinished job found. Updating details.
1057
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1058
+  (0.0ms) SAVEPOINT active_record_1
1059
+ SQL (1.0ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["duration_sec", nil], ["error_message", nil], ["file_size", nil], ["format", "flv"], ["height", nil], ["state", nil], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["url", "http://s3.com/6/7/8.flv"], ["video_id", 1], ["width", nil], ["zencoder_file_id", nil]]
1060
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1061
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1062
+  (0.0ms) SAVEPOINT active_record_1
1063
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1064
+  (0.0ms) SAVEPOINT active_record_1
1065
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:17:23.536124' WHERE "videos"."id" = 1
1066
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1067
+  (0.0ms) SAVEPOINT active_record_1
1068
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1069
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1070
+ Unfinished job found. Updating details.
1071
+ VideoFile Load (0.2ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1072
+  (0.0ms) SAVEPOINT active_record_1
1073
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1074
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1075
+  (0.0ms) SAVEPOINT active_record_1
1076
+ SQL (0.7ms) INSERT INTO "video_file_thumbnails" ("created_at", "thumbnail_content_type", "thumbnail_file_name", "thumbnail_file_size", "thumbnail_updated_at", "updated_at", "video_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["thumbnail_content_type", "png"], ["thumbnail_file_name", "http://s3.com/1/2/3.png"], ["thumbnail_file_size", nil], ["thumbnail_updated_at", nil], ["updated_at", Mon, 05 Dec 2011 19:17:23 UTC +00:00], ["video_id", 1]]
1077
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1078
+  (0.0ms) SAVEPOINT active_record_1
1079
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:17:23.603967' WHERE "videos"."id" = 1
1080
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1081
+  (0.1ms) SAVEPOINT active_record_1
1082
+ SQL (22.2ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1083
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1084
+  (0.0ms) SAVEPOINT active_record_1
1085
+ Origin URL changed. Creating new ZenCoder job.
1086
+ ZenCoder job created, ID = 123
1087
+  (0.2ms) UPDATE "videos" SET "origin_url" = 'http://foo.com/1/2/4', "zencoder_job_id" = '123', "zencoder_job_status" = 'new', "zencoder_job_created" = '2011-12-05 19:19:54.743676', "updated_at" = '2011-12-05 19:19:54.743899' WHERE "videos"."id" = 1
1088
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1089
+  (0.0ms) SAVEPOINT active_record_1
1090
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "finished"]]
1091
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1092
+  (0.0ms) SAVEPOINT active_record_1
1093
+ SQL (1.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1094
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1095
+  (0.1ms) SAVEPOINT active_record_1
1096
+ SQL (0.6ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["duration_sec", 120], ["error_message", nil], ["file_size", 19293819], ["format", "webm"], ["height", 600], ["state", "finished"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["url", "http://parallaxp.s3.amazonaws.com/videos/zc/video-title/file.1.off"], ["video_id", 1], ["width", 800], ["zencoder_file_id", 12345329]]
1097
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1098
+ VideoFile Load (0.2ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1 AND "video_files"."format" = 'webm' LIMIT 1
1099
+  (0.0ms) SAVEPOINT active_record_1
1100
+ SQL (1.6ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "new"]]
1101
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1102
+ Unfinished job found. Updating details.
1103
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1104
+  (0.0ms) SAVEPOINT active_record_1
1105
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1106
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1107
+  (0.0ms) SAVEPOINT active_record_1
1108
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1109
+  (0.0ms) SAVEPOINT active_record_1
1110
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'makin progress', "updated_at" = '2011-12-05 19:19:54.961043' WHERE "videos"."id" = 1
1111
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1112
+  (0.0ms) SAVEPOINT active_record_1
1113
+ SQL (1.4ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1114
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1115
+ Unfinished job found. Updating details.
1116
+ VideoFile Load (0.3ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1117
+  (0.0ms) SAVEPOINT active_record_1
1118
+ SQL (1.1ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["duration_sec", nil], ["error_message", nil], ["file_size", nil], ["format", "flv"], ["height", nil], ["state", nil], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["url", "http://s3.com/6/7/8.flv"], ["video_id", 1], ["width", nil], ["zencoder_file_id", nil]]
1119
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1120
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1121
+  (0.0ms) SAVEPOINT active_record_1
1122
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1123
+  (0.0ms) SAVEPOINT active_record_1
1124
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:19:54.978432' WHERE "videos"."id" = 1
1125
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1126
+  (0.0ms) SAVEPOINT active_record_1
1127
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1128
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1129
+ Unfinished job found. Updating details.
1130
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1131
+  (0.0ms) SAVEPOINT active_record_1
1132
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1133
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1134
+  (0.0ms) SAVEPOINT active_record_1
1135
+ SQL (0.6ms) INSERT INTO "video_file_thumbnails" ("created_at", "thumbnail_content_type", "thumbnail_file_name", "thumbnail_file_size", "thumbnail_updated_at", "updated_at", "video_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["thumbnail_content_type", "png"], ["thumbnail_file_name", "http://s3.com/1/2/3.png"], ["thumbnail_file_size", nil], ["thumbnail_updated_at", nil], ["updated_at", Mon, 05 Dec 2011 19:19:54 UTC +00:00], ["video_id", 1]]
1136
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1137
+  (0.0ms) SAVEPOINT active_record_1
1138
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:19:55.000816' WHERE "videos"."id" = 1
1139
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1140
+  (0.1ms) SAVEPOINT active_record_1
1141
+ SQL (21.6ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:10 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:10 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1142
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1143
+  (0.0ms) SAVEPOINT active_record_1
1144
+ Origin URL changed. Creating new ZenCoder job.
1145
+ ZenCoder job created, ID = 123
1146
+  (0.2ms) UPDATE "videos" SET "origin_url" = 'http://foo.com/1/2/4', "zencoder_job_id" = '123', "zencoder_job_status" = 'new', "zencoder_job_created" = '2011-12-05 19:22:10.914862', "updated_at" = '2011-12-05 19:22:10.915089' WHERE "videos"."id" = 1
1147
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1148
+  (0.1ms) SAVEPOINT active_record_1
1149
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:10 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:10 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "finished"]]
1150
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1151
+  (0.0ms) SAVEPOINT active_record_1
1152
+ SQL (1.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:10 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:10 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1153
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1154
+  (0.1ms) SAVEPOINT active_record_1
1155
+ SQL (0.6ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["duration_sec", 120], ["error_message", nil], ["file_size", 19293819], ["format", "webm"], ["height", 600], ["state", "finished"], ["updated_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["url", "http://parallaxp.s3.amazonaws.com/videos/zc/video-title/file.1.off"], ["video_id", 1], ["width", 800], ["zencoder_file_id", 12345329]]
1156
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1157
+ VideoFile Load (0.4ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1 AND "video_files"."format" = 'webm' LIMIT 1
1158
+  (0.1ms) SAVEPOINT active_record_1
1159
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "new"]]
1160
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1161
+ Unfinished job found. Updating details.
1162
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1163
+  (0.0ms) SAVEPOINT active_record_1
1164
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1165
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1166
+  (0.0ms) SAVEPOINT active_record_1
1167
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1168
+  (0.0ms) SAVEPOINT active_record_1
1169
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'makin progress', "updated_at" = '2011-12-05 19:22:11.107726' WHERE "videos"."id" = 1
1170
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1171
+  (0.0ms) SAVEPOINT active_record_1
1172
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1173
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1174
+ Unfinished job found. Updating details.
1175
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1176
+  (0.0ms) SAVEPOINT active_record_1
1177
+ SQL (1.1ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["duration_sec", nil], ["error_message", nil], ["file_size", nil], ["format", "flv"], ["height", nil], ["state", nil], ["updated_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["url", "http://s3.com/6/7/8.flv"], ["video_id", 1], ["width", nil], ["zencoder_file_id", nil]]
1178
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1179
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1180
+  (0.0ms) SAVEPOINT active_record_1
1181
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1182
+  (0.0ms) SAVEPOINT active_record_1
1183
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:22:11.120747' WHERE "videos"."id" = 1
1184
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1185
+  (0.1ms) SAVEPOINT active_record_1
1186
+ SQL (1.5ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1187
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1188
+ Unfinished job found. Updating details.
1189
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1190
+  (0.0ms) SAVEPOINT active_record_1
1191
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1192
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1193
+  (0.1ms) SAVEPOINT active_record_1
1194
+ SQL (0.7ms) INSERT INTO "video_file_thumbnails" ("created_at", "thumbnail_content_type", "thumbnail_file_name", "thumbnail_file_size", "thumbnail_updated_at", "updated_at", "video_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["thumbnail_content_type", "png"], ["thumbnail_file_name", "http://s3.com/1/2/3.png"], ["thumbnail_file_size", nil], ["thumbnail_updated_at", nil], ["updated_at", Mon, 05 Dec 2011 19:22:11 UTC +00:00], ["video_id", 1]]
1195
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1196
+  (0.0ms) SAVEPOINT active_record_1
1197
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:22:11.143948' WHERE "videos"."id" = 1
1198
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1199
+  (0.1ms) SAVEPOINT active_record_1
1200
+ SQL (18.7ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1201
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1202
+  (0.0ms) SAVEPOINT active_record_1
1203
+ Origin URL changed. Creating new ZenCoder job.
1204
+ ZenCoder job created, ID = 123
1205
+  (0.2ms) UPDATE "videos" SET "origin_url" = 'http://foo.com/1/2/4', "zencoder_job_id" = '123', "zencoder_job_status" = 'new', "zencoder_job_created" = '2011-12-05 19:22:42.870261', "updated_at" = '2011-12-05 19:22:42.870534' WHERE "videos"."id" = 1
1206
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1207
+  (0.0ms) SAVEPOINT active_record_1
1208
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "finished"]]
1209
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1210
+  (0.0ms) SAVEPOINT active_record_1
1211
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", nil]]
1212
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1213
+  (0.1ms) SAVEPOINT active_record_1
1214
+ SQL (0.6ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["duration_sec", 120], ["error_message", nil], ["file_size", 19293819], ["format", "webm"], ["height", 600], ["state", "finished"], ["updated_at", Mon, 05 Dec 2011 19:22:42 UTC +00:00], ["url", "http://parallaxp.s3.amazonaws.com/videos/zc/video-title/file.1.off"], ["video_id", 1], ["width", 800], ["zencoder_file_id", 12345329]]
1215
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1216
+ VideoFile Load (0.2ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1 AND "video_files"."format" = 'webm' LIMIT 1
1217
+  (0.0ms) SAVEPOINT active_record_1
1218
+ SQL (1.1ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "new"]]
1219
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1220
+ Unfinished job found. Updating details.
1221
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1222
+  (0.0ms) SAVEPOINT active_record_1
1223
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1224
+ VideoFileThumbnail Load (0.2ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1225
+  (0.0ms) SAVEPOINT active_record_1
1226
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1227
+  (0.0ms) SAVEPOINT active_record_1
1228
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'makin progress', "updated_at" = '2011-12-05 19:22:43.070084' WHERE "videos"."id" = 1
1229
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1230
+  (0.1ms) SAVEPOINT active_record_1
1231
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1232
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1233
+ Unfinished job found. Updating details.
1234
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1235
+  (0.0ms) SAVEPOINT active_record_1
1236
+ SQL (1.0ms) INSERT INTO "video_files" ("created_at", "duration_sec", "error_message", "file_size", "format", "height", "state", "updated_at", "url", "video_id", "width", "zencoder_file_id") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["duration_sec", nil], ["error_message", nil], ["file_size", nil], ["format", "flv"], ["height", nil], ["state", nil], ["updated_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["url", "http://s3.com/6/7/8.flv"], ["video_id", 1], ["width", nil], ["zencoder_file_id", nil]]
1237
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1238
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1239
+  (0.0ms) SAVEPOINT active_record_1
1240
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1241
+  (0.0ms) SAVEPOINT active_record_1
1242
+  (0.2ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:22:43.083887' WHERE "videos"."id" = 1
1243
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1244
+  (0.1ms) SAVEPOINT active_record_1
1245
+ SQL (1.0ms) INSERT INTO "videos" ("created_at", "origin_url", "title", "updated_at", "zencoder_job_created", "zencoder_job_finished", "zencoder_job_id", "zencoder_job_status") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["origin_url", nil], ["title", "At the Foo Bar"], ["updated_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["zencoder_job_created", nil], ["zencoder_job_finished", nil], ["zencoder_job_id", nil], ["zencoder_job_status", "processing"]]
1246
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1247
+ Unfinished job found. Updating details.
1248
+ VideoFile Load (0.1ms) SELECT "video_files".* FROM "video_files" WHERE "video_files"."video_id" = 1
1249
+  (0.0ms) SAVEPOINT active_record_1
1250
+  (0.0ms) RELEASE SAVEPOINT active_record_1
1251
+ VideoFileThumbnail Load (0.1ms) SELECT "video_file_thumbnails".* FROM "video_file_thumbnails" WHERE "video_file_thumbnails"."video_id" = 1
1252
+  (0.0ms) SAVEPOINT active_record_1
1253
+ SQL (0.7ms) INSERT INTO "video_file_thumbnails" ("created_at", "thumbnail_content_type", "thumbnail_file_name", "thumbnail_file_size", "thumbnail_updated_at", "updated_at", "video_id") VALUES (?, ?, ?, ?, ?, ?, ?) [["created_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["thumbnail_content_type", "png"], ["thumbnail_file_name", "http://s3.com/1/2/3.png"], ["thumbnail_file_size", nil], ["thumbnail_updated_at", nil], ["updated_at", Mon, 05 Dec 2011 19:22:43 UTC +00:00], ["video_id", 1]]
1254
+  (0.1ms) RELEASE SAVEPOINT active_record_1
1255
+  (0.0ms) SAVEPOINT active_record_1
1256
+  (0.1ms) UPDATE "videos" SET "zencoder_job_status" = 'finished', "updated_at" = '2011-12-05 19:22:43.113256' WHERE "videos"."id" = 1
1257
+  (0.1ms) RELEASE SAVEPOINT active_record_1
@@ -1,5 +1,10 @@
1
- class CreateZencodableOutputFilesAssociationTable < ActiveRecord::Migration
1
+ class AddZencoderJobTrackingColumns < ActiveRecord::Migration
2
2
  def change
3
+ add_column :kitteh_movies, :origin_url, :string
4
+ add_column :kitteh_movies, :zencoder_job_status, :string
5
+ add_column :kitteh_movies, :zencoder_job_created, :datetime
6
+ add_column :kitteh_movies, :zencoder_job_finished, :datetime
7
+
3
8
  create_table "encoded_kitteh_vids" do |t|
4
9
  t.string "url"
5
10
  t.string "format"
@@ -13,5 +18,7 @@ class CreateZencodableOutputFilesAssociationTable < ActiveRecord::Migration
13
18
  t.string "state"
14
19
  t.timestamps
15
20
  end
21
+
22
+
16
23
  end
17
24
  end
@@ -9,19 +9,13 @@ class ZencodableGeneratorTest < Rails::Generators::TestCase
9
9
 
10
10
  test "creates a migration for the output files model" do
11
11
  run_generator %w(KittehMovie encoded_kitteh_vids)
12
- assert_migration "db/migrate/create_encoded_kitteh_vids.rb" do |migration|
12
+ assert_migration "db/migrate/zencodable_add_tracking_columns_and_tables.rb" do |migration|
13
13
  assert_match /create_table "encoded_kitteh_vids"/, migration
14
14
  assert_match /t\.integer\s+\"kitteh_movie_id\"/, migration
15
- end
16
- assert_migration "db/migrate/create_encoded_kitteh_vids_thumbnails.rb" do |migration|
15
+
17
16
  assert_match /create_table "encoded_kitteh_vid_thumbnails"/, migration
18
17
  assert_match /t\.integer\s+\"kitteh_movie_id\"/, migration
19
- end
20
- end
21
18
 
22
- test "creates a migration to add job tracking columns to the named model" do
23
- run_generator %w(KittehMovie encoded_kitteh_vids)
24
- assert_migration "db/migrate/add_zencoder_job_tracking_columns_to_kitteh_movies.rb" do |migration|
25
19
  assert_match /add_column :kitteh_movies, :origin_url, :string/, migration
26
20
  assert_match /add_column :kitteh_movies, :zencoder_job_status, :string/, migration
27
21
  assert_match /add_column :kitteh_movies, :zencoder_job_created, :datetime/, migration
@@ -31,8 +25,9 @@ class ZencodableGeneratorTest < Rails::Generators::TestCase
31
25
 
32
26
  test "does not create a migration for the thumbnails when --skip_thumbnails is given" do
33
27
  run_generator %w(KittehMovie encoded_kitteh_vids --skip-thumbnails)
34
- assert_migration "db/migrate/create_encoded_kitteh_vids.rb"
35
- assert_no_migration "db/migrate/create_encoded_kitteh_vids_thumbnails.rb"
28
+ assert_migration "db/migrate/zencodable_add_tracking_columns_and_tables.rb" do |migration|
29
+ assert_no_match /create_table "encoded_kitteh_vid_thumbnails"/, migration
30
+ end
36
31
  end
37
32
 
38
33
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: zencodable
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.2
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sam Beam
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-12-02 00:00:00 Z
13
+ date: 2011-12-05 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -100,9 +100,7 @@ extra_rdoc_files: []
100
100
 
101
101
  files:
102
102
  - lib/generators/zencodable/migration_generator.rb
103
- - lib/generators/zencodable/templates/add_zencoder_job_tracking_columns.rb
104
- - lib/generators/zencodable/templates/create_association_table.rb
105
- - lib/generators/zencodable/templates/create_association_thumbnails_table.rb
103
+ - lib/generators/zencodable/templates/zencodable_add_tracking_columns_and_tables.rb
106
104
  - lib/zencodable/version.rb
107
105
  - lib/zencodable.rb
108
106
  - MIT-LICENSE
@@ -150,13 +148,12 @@ files:
150
148
  - test/dummy/public/favicon.ico
151
149
  - test/dummy/Rakefile
152
150
  - test/dummy/script/rails
153
- - test/dummy/tmp/db/migrate/20111202214515_add_zencoder_job_tracking_columns_to_kitteh_movies.rb
154
- - test/dummy/tmp/db/migrate/20111202214515_create_encoded_kitteh_vids.rb
151
+ - test/dummy/tmp/db/migrate/20111205192243_zencodable_add_tracking_columns_and_tables.rb
155
152
  - test/factories.rb
156
153
  - test/test_helper.rb
157
154
  - test/zencodable_generators_test.rb
158
155
  - test/zencodable_test.rb
159
- homepage: http://onsetcorps.net
156
+ homepage: https://github.com/sbeam/zencodable
160
157
  licenses: []
161
158
 
162
159
  post_install_message:
@@ -226,8 +223,7 @@ test_files:
226
223
  - test/dummy/public/favicon.ico
227
224
  - test/dummy/Rakefile
228
225
  - test/dummy/script/rails
229
- - test/dummy/tmp/db/migrate/20111202214515_add_zencoder_job_tracking_columns_to_kitteh_movies.rb
230
- - test/dummy/tmp/db/migrate/20111202214515_create_encoded_kitteh_vids.rb
226
+ - test/dummy/tmp/db/migrate/20111205192243_zencodable_add_tracking_columns_and_tables.rb
231
227
  - test/factories.rb
232
228
  - test/test_helper.rb
233
229
  - test/zencodable_generators_test.rb
@@ -1,8 +0,0 @@
1
- class AddZencoderJobTrackingColumns < ActiveRecord::Migration
2
- def change
3
- add_column :<%= name.tableize %>, :origin_url, :string
4
- add_column :<%= name.tableize %>, :zencoder_job_status, :string
5
- add_column :<%= name.tableize %>, :zencoder_job_created, :datetime
6
- add_column :<%= name.tableize %>, :zencoder_job_finished, :datetime
7
- end
8
- end
@@ -1,17 +0,0 @@
1
- class CreateZencodableOutputFilesAssociationTable < ActiveRecord::Migration
2
- def change
3
- create_table "<%= association_name %>" do |t|
4
- t.string "url"
5
- t.string "format"
6
- t.integer "zencoder_file_id"
7
- t.integer "<%= name.foreign_key %>"
8
- t.datetime "created_at"
9
- t.integer "width"
10
- t.integer "height"
11
- t.integer "file_size"
12
- t.string "error_message"
13
- t.string "state"
14
- t.timestamps
15
- end
16
- end
17
- end
@@ -1,12 +0,0 @@
1
- class CreateZencodableOutputFilesAssociationTable < ActiveRecord::Migration
2
- def change
3
- create_table "<%= association_name.singularize %>_thumbnails" do |t|
4
- t.string "thumbnail_file_name"
5
- t.string "thumbnail_content_type"
6
- t.integer "thumbnail_file_size"
7
- t.datetime "thumbnail_updated_at"
8
- t.integer "<%= name.foreign_key %>"
9
- t.timestamps
10
- end
11
- end
12
- end
@@ -1,8 +0,0 @@
1
- class AddZencoderJobTrackingColumns < ActiveRecord::Migration
2
- def change
3
- add_column :kitteh_movies, :origin_url, :string
4
- add_column :kitteh_movies, :zencoder_job_status, :string
5
- add_column :kitteh_movies, :zencoder_job_created, :datetime
6
- add_column :kitteh_movies, :zencoder_job_finished, :datetime
7
- end
8
- end