woody-decorators 8.1.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 846a926045277b0bfcd6f0fb2ef430d364352d8e
4
- data.tar.gz: 834ff3f599cab004354149c8f9b50f006b6297d5
3
+ metadata.gz: 39f4d68954a8c7dacd8d33f1edd81bb32222ddb8
4
+ data.tar.gz: 1fb4fe7e06ad6d91357ad8bc346dd27c92b738ff
5
5
  SHA512:
6
- metadata.gz: 50bbf84261c3e2af3ddd89991cccc9319622b99c9ebca0b2b17b65ba25c104aa3f25a85d951078e3cd5371016b28f44959f536a57fa1a78ab958c2bf5ec22369
7
- data.tar.gz: b0bc2660f5525e305c403f66c0c0826cb50f4ba8f8792fce91a90a2a63f15731a7ee15e081c03e585076952ed2b58fc4a3c60a2cacc4f30a3e127cd77e5ff603
6
+ metadata.gz: 470bfadfb9e160cf621856bdae5e9c68b4746b15f89d6ff5201eb43c18699be2b70bac0ace46a702eea23a735d4bd8264a10f072840e98fc009a4ea0b94fcfb3
7
+ data.tar.gz: 8f0e752eaa52768d0c03568bd43395eb87feb5633c9dd56d518d050df5949d05e757f72c9f5abc54cd446847d53321f7d60a977e00290a78cbbf454d371232d1
@@ -1,5 +1,5 @@
1
1
  module Woody
2
2
  module Decorators
3
- VERSION = '8.1.0'.freeze
3
+ VERSION = '8.2.0'.freeze
4
4
  end
5
5
  end
@@ -37,16 +37,26 @@ module Woody
37
37
  case @model.category
38
38
  when 'brand'
39
39
  @model.status == 'published' &&
40
- DateTime.parse(@model.end_date) < DateTime.now
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
- end_date < DateTime.now
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.1.0
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-10-31 00:00:00.000000000 Z
11
+ date: 2016-11-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler