epom_rails 1.3.6 → 1.4.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: 26630917caa4309b84a7eb2378556652bcb88fc2
4
- data.tar.gz: e8117d6c261729f0544ca95b104d33f2c35cd043
3
+ metadata.gz: 6b4ff1124edad29a8192cdb4ccefc7c2dc042cbe
4
+ data.tar.gz: 63096cb4574c15f7e2d41f520897e1efb8673905
5
5
  SHA512:
6
- metadata.gz: 2b288b462350506d60183b1a0483b45dcaabb0119aa71f9333bf19520728197ca7d5d2eb442caed331fba8330293db70470ce6a712c5666d2bdd61566923d426
7
- data.tar.gz: ba5e07b569509ed16496ef041a86843ba7aaa216a661452fd8311038a831a698d76a598745aeefe575c6fb3b922635382b733424672331d47e1020062e645b8d
6
+ metadata.gz: b8090c1ef2adea4906553b5752f04acb51c43ff8b212248b9ea20e358d10cb42567e0f4913abd2052dabcf5f3874f72657a81a6e6580b6f3762c824edbf27b02
7
+ data.tar.gz: 5a6f5c878eebaaf95c1197afd114631910883ec7b095b22697c0cadf4e0d3890f335c2754a7fc6e7dd8c35a5191d71d0b8b207ee3f7209ae451bb4860bfe6f1b
@@ -3,6 +3,21 @@ class ActiveRecord::Base
3
3
  def self.acts_as_placement(params = {})
4
4
  EpomRails.config.placement[:model] = self
5
5
  acts_as(Epom::Placement, params)
6
+
7
+ define_key_method
6
8
  end
7
9
 
10
+ private
11
+ def self.define_key_method
12
+ self.class_eval do
13
+ def epom_key
14
+ unless @epom_key
15
+ response = Epom::Placement.get_placement_summary({placementIds: self.epom_id})
16
+ @epom_key = response[0]['key']
17
+ end
18
+ @epom_key
19
+ end
20
+ end
21
+ end
22
+
8
23
  end
@@ -1,3 +1,3 @@
1
1
  module EpomRails
2
- VERSION = "1.3.6"
2
+ VERSION = "1.4.0"
3
3
  end
@@ -57,4 +57,15 @@ class ActsAsPlacementTest < ActiveSupport::TestCase
57
57
  assert_instance_of Array, epom_response
58
58
  end
59
59
  end
60
+
61
+ test 'key method' do
62
+ unless EpomRails.config.offline
63
+ placement = placements(:two)
64
+ placement.epom_id = nil
65
+
66
+ assert placement.save
67
+ epom_key = placement.epom_key
68
+ assert_equal epom_key, placement.instance_variable_get('@epom_key')
69
+ end
70
+ end
60
71
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: epom_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.6
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adrian Chang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-16 00:00:00.000000000 Z
11
+ date: 2015-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 0.10.5
33
+ version: 0.10.10
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 0.10.5
40
+ version: 0.10.10
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -260,6 +260,9 @@ test_files:
260
260
  - test/epom_rails/acts_as_banner_test.rb
261
261
  - test/epom_rails/acts_as_analytic_test.rb
262
262
  - test/epom_rails/acts_as_advertiser_test.rb
263
+ - test/dummy/config.ru
264
+ - test/dummy/Rakefile
265
+ - test/dummy/README.rdoc
263
266
  - test/dummy/test/models/zone_test.rb
264
267
  - test/dummy/test/models/user_test.rb
265
268
  - test/dummy/test/models/publisher_test.rb
@@ -300,6 +303,10 @@ test_files:
300
303
  - test/dummy/db/migrate/20150603151041_create_advertisers.rb
301
304
  - test/dummy/config/secrets.yml
302
305
  - test/dummy/config/routes.rb
306
+ - test/dummy/config/environment.rb
307
+ - test/dummy/config/database.yml
308
+ - test/dummy/config/boot.rb
309
+ - test/dummy/config/application.rb
303
310
  - test/dummy/config/locales/en.yml
304
311
  - test/dummy/config/initializers/wrap_parameters.rb
305
312
  - test/dummy/config/initializers/session_store.rb
@@ -312,11 +319,6 @@ test_files:
312
319
  - test/dummy/config/environments/test.rb
313
320
  - test/dummy/config/environments/production.rb
314
321
  - test/dummy/config/environments/development.rb
315
- - test/dummy/config/environment.rb
316
- - test/dummy/config/database.yml
317
- - test/dummy/config/boot.rb
318
- - test/dummy/config/application.rb
319
- - test/dummy/config.ru
320
322
  - test/dummy/bin/setup
321
323
  - test/dummy/bin/rake
322
324
  - test/dummy/bin/rails
@@ -398,5 +400,3 @@ test_files:
398
400
  - test/dummy/app/assets/javascripts/application.js
399
401
  - test/dummy/app/assets/javascripts/analytics.js
400
402
  - test/dummy/app/assets/javascripts/advertisers.js
401
- - test/dummy/Rakefile
402
- - test/dummy/README.rdoc