woody-decorators 2.2.0 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/woody/decorators.rb +1 -1
- data/lib/woody/decorators/helper/aspect_ratio.rb +1 -1
- data/lib/woody/decorators/video.rb +11 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: baf802b86d47ec5d5b59a68608a04a1299d52cd9
|
4
|
+
data.tar.gz: 865cefa4f02a3f368ee947b1f8d04d4b16151248
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4111f1da419ab2e9d97ef12a531ec1d5e1a88f15fe783530539a7892b35b0818ba32fedb3e734bcf54a3cb96d7b2d8077c8731b885ccffd90db38113b81c95d1
|
7
|
+
data.tar.gz: de50b03b6600ee3917ab31a87ff896bae3b92a4d8e8bfc0101deac14a62eaa3f0920b2bbcf39f9a8ea7095d8efdcc81a3e62bb1722a4c5a7b3d3f0387215d8d0
|
data/lib/woody/decorators.rb
CHANGED
@@ -2,6 +2,7 @@ require "wes/cloudkit"
|
|
2
2
|
require "wes/data/api/brand"
|
3
3
|
require "wes/data/api/challenge"
|
4
4
|
require "wes/data/api/submission"
|
5
|
+
require "wes/data/api/creator_user"
|
5
6
|
require "woody/decorators/base"
|
6
7
|
require "woody/decorators/video_transcoding_state"
|
7
8
|
require "woody/decorators/helper/aspect_ratio"
|
@@ -9,8 +10,9 @@ require "woody/decorators/helper/aspect_ratio"
|
|
9
10
|
module Woody
|
10
11
|
module Decorators
|
11
12
|
class Video < Base
|
12
|
-
def initialize(model, config)
|
13
|
-
@config
|
13
|
+
def initialize(model, config, creator_model = nil)
|
14
|
+
@config = config
|
15
|
+
@creator_model = creator_model
|
14
16
|
super(model)
|
15
17
|
end
|
16
18
|
|
@@ -31,6 +33,13 @@ module Woody
|
|
31
33
|
)
|
32
34
|
end
|
33
35
|
|
36
|
+
def creator
|
37
|
+
@creator ||= @creator_model ? @creator_model : Wes::Data::API::CreatorUser.find(
|
38
|
+
:id,
|
39
|
+
submission.user_id
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
34
43
|
def gif
|
35
44
|
return "https://i.imgur.com/jZCPUYx.gif" if dev?
|
36
45
|
video_transcoding_state("gif").path(filename_hash)
|