woody-decorators 2.5.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 916926f37a5e91d2bea8b35ce35228c7664a5343
4
- data.tar.gz: add9e0ba06c1694db3a507e9d5f2f5039c2c2b89
3
+ metadata.gz: 1bb25f40b3a57d527127709e8b50a8ce1faafa21
4
+ data.tar.gz: 10b464d1910aeaa4e0d4c8be6c6b9d3405c6c4b9
5
5
  SHA512:
6
- metadata.gz: b19af240f1440f3f70b4ef25b44aa96d2ec3e96235cd21d020993ee530827bbc9840d612d20635bca707ba17549c033fdb6c1a233e3cb6b6de9756f480b68df6
7
- data.tar.gz: 836688605591d42db75e1c5d4614e8832ff711126d84b068c4c4b2682d6a631ecf69c8e9be2d5222f49687e428f9ecd67c09e0fd9d486e2bec65e8bd0185a786
6
+ metadata.gz: 3aff26447d61dff8b6e8779918ecf6848eef5ecbf07dee226cf28a9e2606aef04886614303a8c202cd07f07b00585b440dd5eb88acbf485a84cab96a93f8db50
7
+ data.tar.gz: 8d23027f22ad98c7c05a88305a174afd4c969cf0512f5d7e4b5355ae547f6698e46d21d9060133d3cb7e16896143f695a06e8e841bad952ae010f317ad4bdcae
@@ -1,5 +1,5 @@
1
1
  module Woody
2
2
  module Decorators
3
- VERSION = "2.5.0".freeze
3
+ VERSION = "3.0.0".freeze
4
4
  end
5
5
  end
@@ -7,6 +7,11 @@ require "woody/decorators/challenge_question"
7
7
  module Woody
8
8
  module Decorators
9
9
  class Challenge < Base
10
+ def initialize(model, config)
11
+ @config = config
12
+ super(model)
13
+ end
14
+
10
15
  def brand_name
11
16
  brand.name
12
17
  end
@@ -36,6 +41,15 @@ module Woody
36
41
  @model.image_exists
37
42
  end
38
43
 
44
+ def image_url
45
+ format(
46
+ "%s/%s/brands/campaign_image/%s",
47
+ @config.s3_domain,
48
+ @config.public_s3_bucket,
49
+ @model.short_hash
50
+ )
51
+ end
52
+
39
53
  def reward_total
40
54
  @model.rewards.inject(0) do |total, reward|
41
55
  total + (reward.quantity * reward.amount)
@@ -5,9 +5,15 @@ require "woody/decorators/challenge"
5
5
  module Woody
6
6
  module Decorators
7
7
  class Submission < Base
8
+ def initialize(model, config)
9
+ @config = config
10
+ super(model)
11
+ end
12
+
8
13
  def challenge
9
14
  @challenge ||= Woody::Decorators::Challenge.new(
10
- Wes::Data::API::Challenge.find(:id, @model.challenge_id)
15
+ Wes::Data::API::Challenge.find(:id, @model.challenge_id),
16
+ @config
11
17
  )
12
18
  end
13
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody-decorators
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ''