woody-decorators 8.1.0 → 8.2.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/brief.rb +13 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39f4d68954a8c7dacd8d33f1edd81bb32222ddb8
|
4
|
+
data.tar.gz: 1fb4fe7e06ad6d91357ad8bc346dd27c92b738ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 470bfadfb9e160cf621856bdae5e9c68b4746b15f89d6ff5201eb43c18699be2b70bac0ace46a702eea23a735d4bd8264a10f072840e98fc009a4ea0b94fcfb3
|
7
|
+
data.tar.gz: 8f0e752eaa52768d0c03568bd43395eb87feb5633c9dd56d518d050df5949d05e757f72c9f5abc54cd446847d53321f7d60a977e00290a78cbbf454d371232d1
|
data/lib/woody/decorators.rb
CHANGED
@@ -37,16 +37,26 @@ module Woody
|
|
37
37
|
case @model.category
|
38
38
|
when 'brand'
|
39
39
|
@model.status == 'published' &&
|
40
|
-
|
40
|
+
parsed_end_date < DateTime.now
|
41
41
|
when 'vidsy'
|
42
|
-
end_date = DateTime.parse(submission.created_at).advance(hours: @model.duration)
|
43
42
|
@model.status == 'published' &&
|
44
|
-
|
43
|
+
parsed_end_date(submission) < DateTime.now
|
45
44
|
when 'squad'
|
46
45
|
false
|
47
46
|
end
|
48
47
|
end
|
49
48
|
|
49
|
+
def parsed_end_date(submission = nil)
|
50
|
+
case @model.category
|
51
|
+
when 'brand'
|
52
|
+
DateTime.parse(@model.end_date)
|
53
|
+
when 'vidsy'
|
54
|
+
DateTime.parse(submission.created_at).advance(hours: @model.duration)
|
55
|
+
when 'squad'
|
56
|
+
nil
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
50
60
|
def essentials_questions
|
51
61
|
questions.fetch('essentials') { {} }
|
52
62
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: woody-decorators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 8.
|
4
|
+
version: 8.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|