vanity 2.2.9 → 2.2.10

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: ca984620557d326a44e57c76e179701e43c784aa
4
- data.tar.gz: 3a27cad8226fbdf3e56709291b1ed2afc1793acd
3
+ metadata.gz: b58da5ddd59dcdd27e4742ad396ae92e3dd80f45
4
+ data.tar.gz: 0aa99c5fa92179b2f3c0f43b1e91ddf187650ccf
5
5
  SHA512:
6
- metadata.gz: 1e3a77b2540e8726b77bc6f5ec80226f39b7f499abd271d2e5bc20c51131998472e0dffa0879cdf799e1a4de7e7b6cc052e1ea2e87b85fc09bb584df21e8293c
7
- data.tar.gz: 761fb69735eb0b02e8267a24243bb7cf923ccd8880a14ed691ae55f207aa73c4bed6e5c2566e6179aa264c6defacf519462db3c8106830e5a1432f53607d590c
6
+ metadata.gz: 43fb068dc90d3dc6a8e57db177635e1aace3c3928c4f0085dfce9965120d282df05d895c0bcfc2d6d742329792cf2552d0b475316a0307657873d006fcd8b776
7
+ data.tar.gz: aff2012cc568b8b689b9b0f6570fa5c4c1be7ad39fd2264cd35d0faa70e040aedb66d52d93b3641102a8f4b6ee535a0ca3060b2e3820ff6585b4df90f8ea8868
data/CHANGELOG CHANGED
@@ -1,5 +1,10 @@
1
1
  == Unreleased
2
2
 
3
+ == 2.2.10 (2018-03-18)
4
+
5
+ * Fix broken table size in report dashboard (#339) (@ilyasovd)
6
+ * Prevent dupe participation in same experiment (#335)(@pihman)
7
+
3
8
  == 2.2.9 (2018-02-03)
4
9
 
5
10
  * Fix race condition using the activerecord adapater when vanity creates experiments or rows in the conversions table (@fcheung)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vanity (2.2.9)
4
+ vanity (2.2.10)
5
5
  i18n
6
6
 
7
7
  GEM
@@ -32,6 +32,7 @@ GEM
32
32
  execjs
33
33
  coffee-script-source (1.9.1)
34
34
  colorator (0.1)
35
+ concurrent-ruby (1.0.5)
35
36
  crack (0.3.1)
36
37
  execjs (2.5.2)
37
38
  fakefs (0.6.7)
@@ -41,7 +42,8 @@ GEM
41
42
  activesupport (>= 2.2.0)
42
43
  crack (>= 0.1.6)
43
44
  hitimes (1.2.2)
44
- i18n (0.7.0)
45
+ i18n (0.9.3)
46
+ concurrent-ruby (~> 1.0)
45
47
  integration (0.1.0)
46
48
  jdbc-sqlite3 (3.8.7)
47
49
  jekyll (2.5.3)
@@ -143,4 +145,4 @@ DEPENDENCIES
143
145
  yard
144
146
 
145
147
  BUNDLED WITH
146
- 1.11.2
148
+ 1.13.0
@@ -5,9 +5,9 @@ GIT
5
5
  fastthread (1.0.7)
6
6
 
7
7
  PATH
8
- remote: ..
8
+ remote: ../
9
9
  specs:
10
- vanity (2.2.9)
10
+ vanity (2.2.10)
11
11
  i18n
12
12
 
13
13
  GEM
@@ -239,4 +239,4 @@ DEPENDENCIES
239
239
  yard
240
240
 
241
241
  BUNDLED WITH
242
- 1.11.2
242
+ 1.13.0
@@ -5,9 +5,9 @@ GIT
5
5
  fastthread (1.0.7)
6
6
 
7
7
  PATH
8
- remote: .././
8
+ remote: ../
9
9
  specs:
10
- vanity (2.2.9)
10
+ vanity (2.2.10)
11
11
  i18n
12
12
 
13
13
  GEM
@@ -227,4 +227,4 @@ DEPENDENCIES
227
227
  yard
228
228
 
229
229
  BUNDLED WITH
230
- 1.11.2
230
+ 1.13.0
@@ -5,9 +5,9 @@ GIT
5
5
  fastthread (1.0.7)
6
6
 
7
7
  PATH
8
- remote: ..
8
+ remote: ../
9
9
  specs:
10
- vanity (2.2.9)
10
+ vanity (2.2.10)
11
11
  i18n
12
12
 
13
13
  GEM
@@ -253,4 +253,4 @@ DEPENDENCIES
253
253
  yard
254
254
 
255
255
  BUNDLED WITH
256
- 1.11.2
256
+ 1.13.0
@@ -7,13 +7,14 @@ GIT
7
7
  PATH
8
8
  remote: ../
9
9
  specs:
10
- vanity (2.2.9)
10
+ vanity (2.2.10)
11
11
  i18n
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
16
  RedCloth (4.2.9)
17
+ RedCloth (4.2.9-java)
17
18
  actionmailer (4.2.0)
18
19
  actionpack (= 4.2.0)
19
20
  actionview (= 4.2.0)
@@ -43,6 +44,8 @@ GEM
43
44
  activemodel (= 4.2.0)
44
45
  activesupport (= 4.2.0)
45
46
  arel (~> 6.0)
47
+ activerecord-jdbc-adapter (1.3.15)
48
+ activerecord (>= 2.2)
46
49
  activesupport (4.2.0)
47
50
  i18n (~> 0.7)
48
51
  json (~> 1.7, >= 1.7.7)
@@ -57,6 +60,7 @@ GEM
57
60
  arel (6.0.3)
58
61
  blankslate (2.1.2.4)
59
62
  bson (4.0.2)
63
+ bson (4.0.2-java)
60
64
  builder (3.2.2)
61
65
  classifier-reborn (2.0.3)
62
66
  fast-stemmer (~> 1.0)
@@ -83,6 +87,7 @@ GEM
83
87
  hashdiff (0.2.3)
84
88
  i18n (0.7.0)
85
89
  integration (0.1.0)
90
+ jdbc-sqlite3 (3.8.7)
86
91
  jekyll (2.5.3)
87
92
  classifier-reborn (~> 2.0)
88
93
  colorator (~> 0.1)
@@ -106,6 +111,8 @@ GEM
106
111
  sass (~> 3.4)
107
112
  jekyll-watch (1.3.0)
108
113
  listen (~> 3.0)
114
+ json (1.8.2)
115
+ json (1.8.2-java)
109
116
  json (1.8.3)
110
117
  kramdown (1.9.0)
111
118
  liquid (2.6.2)
@@ -120,12 +127,16 @@ GEM
120
127
  metaclass (0.0.4)
121
128
  method_source (0.8.2)
122
129
  mime-types (2.99)
130
+ mini_portile (0.6.2)
123
131
  mini_portile2 (2.0.0)
124
132
  minitest (5.8.3)
125
133
  mocha (1.1.0)
126
134
  metaclass (~> 0.0.1)
127
135
  mongo (2.2.3)
128
136
  bson (~> 4.0)
137
+ nokogiri (1.6.5)
138
+ mini_portile (~> 0.6.0)
139
+ nokogiri (1.6.5-java)
129
140
  nokogiri (1.6.7.1)
130
141
  mini_portile2 (~> 2.0.0.rc2)
131
142
  parslet (1.5.0)
@@ -193,7 +204,8 @@ GEM
193
204
  sprockets (>= 3.0.0)
194
205
  sqlite3 (1.3.11)
195
206
  thor (0.19.1)
196
- thread_safe (0.3.5)
207
+ thread_safe (0.3.4)
208
+ thread_safe (0.3.4-java)
197
209
  timecop (0.8.0)
198
210
  toml (0.1.2)
199
211
  parslet (~> 1.5.0)
@@ -207,6 +219,7 @@ GEM
207
219
  yard (0.8.7.6)
208
220
 
209
221
  PLATFORMS
222
+ java
210
223
  ruby
211
224
 
212
225
  DEPENDENCIES
@@ -239,4 +252,4 @@ DEPENDENCIES
239
252
  yard
240
253
 
241
254
  BUNDLED WITH
242
- 1.11.2
255
+ 1.13.0
@@ -7,7 +7,7 @@ GIT
7
7
  PATH
8
8
  remote: ../
9
9
  specs:
10
- vanity (2.2.9)
10
+ vanity (2.2.10)
11
11
  i18n
12
12
 
13
13
  GEM
@@ -253,4 +253,4 @@ DEPENDENCIES
253
253
  yard
254
254
 
255
255
  BUNDLED WITH
256
- 1.10.6
256
+ 1.13.0
@@ -0,0 +1,24 @@
1
+ require "vanity/adapters/active_record_adapter"
2
+
3
+ class AddParticipansUniqueIndexMigration < ActiveRecord::Migration
4
+ # Helper methods to ensure we're connecting to the right database, see
5
+ # https://github.com/assaf/vanity/issues/295.
6
+
7
+ def connection
8
+ @connection ||= ActiveRecord::Base.connection
9
+ end
10
+ alias_method :default_connection, :connection
11
+
12
+ def with_vanity_connection
13
+ @connection = Vanity::Adapters::ActiveRecordAdapter::VanityRecord.connection
14
+ yield
15
+ @connection = default_connection
16
+ end
17
+
18
+ def change
19
+ with_vanity_connection do
20
+ remove_index :vanity_participants, :name => "by_experiment_id_and_identity"
21
+ add_index :vanity_participants, [:experiment_id, :identity], :name => "by_experiment_id_and_identity", :unique => true
22
+ end
23
+ end
24
+ end
@@ -56,7 +56,7 @@ class VanityMigration < ActiveRecord::Migration
56
56
  t.timestamps null: false
57
57
  end
58
58
  add_index :vanity_participants, [:experiment_id]
59
- add_index :vanity_participants, [:experiment_id, :identity], :name => "by_experiment_id_and_identity"
59
+ add_index :vanity_participants, [:experiment_id, :identity], :name => "by_experiment_id_and_identity", :unique => true
60
60
  add_index :vanity_participants, [:experiment_id, :shown], :name => "by_experiment_id_and_shown"
61
61
  add_index :vanity_participants, [:experiment_id, :seen], :name => "by_experiment_id_and_seen"
62
62
  add_index :vanity_participants, [:experiment_id, :converted], :name => "by_experiment_id_and_converted"
@@ -0,0 +1,15 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ class Vanity::AddParticipantsUniqueIndexGenerator < Rails::Generators::Base
5
+ include Rails::Generators::Migration
6
+ source_root File.expand_path('../../templates', __FILE__)
7
+
8
+ def self.next_migration_number(path)
9
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
10
+ end
11
+
12
+ def create_model_file
13
+ migration_template "add_participants_unique_index_migration.rb", "db/migrate/add_participants_unique_index_migration.rb"
14
+ end
15
+ end
@@ -102,12 +102,22 @@ module Vanity
102
102
  # passed then this will be passed to create if creating, or will be
103
103
  # used to update the found participant.
104
104
  def self.retrieve(experiment, identity, create = true, update_with = nil)
105
- if record = VanityParticipant.where(:experiment_id=>experiment.to_s, :identity=>identity.to_s).first
106
- record.update_attributes(update_with) if update_with
107
- elsif create
108
- record = VanityParticipant.create({ :experiment_id=>experiment.to_s, :identity=>identity.to_s }.merge(update_with || {}))
105
+ retried = false
106
+ begin
107
+ if record = VanityParticipant.where(:experiment_id => experiment.to_s, :identity => identity.to_s).first
108
+ record.update_attributes(update_with) if update_with
109
+ elsif create
110
+ record = VanityParticipant.create({ :experiment_id => experiment.to_s, :identity => identity.to_s }.merge(update_with || {}))
111
+ end
112
+ record
113
+ rescue ActiveRecord::RecordNotUnique => e
114
+ if retried
115
+ raise e
116
+ else
117
+ retried = true
118
+ retry
119
+ end
109
120
  end
110
- record
111
121
  end
112
122
  end
113
123
 
@@ -13,15 +13,15 @@
13
13
  .vanity .experiment .status_disabled { background: #FEE }
14
14
  .vanity .experiment .enabled-links { float: right; font-weight: normal }
15
15
 
16
- .vanity .ab_test table { border-collapse: collapse; table-layout: fixed; width: 100%; border-bottom: 1px solid #ccc; margin: 1em 0 0 0 }
17
- .vanity .ab_test td { padding: .5em; border-top: 1px solid #ccc; width: 2em; overflow: hidden }
16
+ .vanity .ab_test table { border-collapse: collapse; width: 100%; border-bottom: 1px solid #ccc; margin: 1em 0 0 0 }
17
+ .vanity .ab_test td { padding: .5em; border-top: 1px solid #ccc; overflow: hidden }
18
18
  .vanity .ab_test .choice td { font-weight: bold; background: #f0f0f8 }
19
19
  .vanity .ab_test caption { caption-side: bottom; padding: .5em; background: transparent; text-align: left }
20
20
  .vanity .ab_test caption .disabled_info { padding-top: .5em }
21
- .vanity .ab_test td.option { width: 5em; white-space: nowrap; overflow: hidden }
21
+ .vanity .ab_test td.option { white-space: nowrap; overflow: hidden }
22
22
  .vanity .ab_test td.option .default { font-size: 75% }
23
- .vanity .ab_test td.value { width: 8em; white-space: nowrap; overflow: hidden }
24
- .vanity .ab_test td.action { width: 6em; overflow: hidden; text-align: right }
23
+ .vanity .ab_test td.value { white-space: nowrap; overflow: hidden }
24
+ .vanity .ab_test td.action { overflow: hidden; text-align: right }
25
25
  .vanity .ab_test button.reset { float: right }
26
26
 
27
27
  .vanity .metrics { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid #ddd }
@@ -1,5 +1,5 @@
1
1
  module Vanity
2
- VERSION = "2.2.9"
2
+ VERSION = "2.2.10"
3
3
 
4
4
  module Version
5
5
  version = VERSION.to_s.split(".").map { |i| i.to_i }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vanity
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.9
4
+ version: 2.2.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Assaf Arkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-03 00:00:00.000000000 Z
11
+ date: 2018-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -177,8 +177,10 @@ files:
177
177
  - gemfiles/rails42_protected_attributes.gemfile.lock
178
178
  - gemfiles/rails5.gemfile
179
179
  - gemfiles/rails5.gemfile.lock
180
+ - lib/generators/templates/add_participants_unique_index_migration.rb
180
181
  - lib/generators/templates/add_unique_indexes_migration.rb
181
182
  - lib/generators/templates/vanity_migration.rb
183
+ - lib/generators/vanity/add_participants_unique_index_generator.rb
182
184
  - lib/generators/vanity/add_unique_indexes_generator.rb
183
185
  - lib/generators/vanity/views_generator.rb
184
186
  - lib/generators/vanity_generator.rb
@@ -292,7 +294,7 @@ metadata: {}
292
294
  post_install_message: To get started run vanity --help
293
295
  rdoc_options:
294
296
  - "--title"
295
- - Vanity 2.2.9
297
+ - Vanity 2.2.10
296
298
  - "--main"
297
299
  - README.md
298
300
  - "--webcvs"