easy_ab 0.5.1 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/easy_ab/helpers.rb +7 -0
- data/lib/easy_ab/rspec/spec_helper.rb +2 -1
- data/lib/easy_ab/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8cd5663800f95a25d8b2f0f2d99b8508ecd6d6bc
|
4
|
+
data.tar.gz: ea5e1e9ff71f6cda662273f46e8ef2e5508fe8fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 778ccea1ce66bcb4471af2484eaa86017dce4359816c5c22229ac0fb4018aeda2d00a96661c80a969ad0c4977c6bbc2c90c56b42b36b5c628c532bfd9df6e2a5
|
7
|
+
data.tar.gz: dc67c24dadb423e971e49d4ddcdc77dbe03aed2feedaf46d04c897434ccaf94e696496eb6dae66ef1ebd70dd6770915d8361e547bce5f794549b6952e76b16e8
|
data/CHANGELOG.md
CHANGED
data/lib/easy_ab/helpers.rb
CHANGED
@@ -77,6 +77,13 @@ module EasyAb
|
|
77
77
|
block_given? ? yield(variant) : variant
|
78
78
|
end
|
79
79
|
|
80
|
+
def assign_variant!(user, experiment, variant)
|
81
|
+
g = EasyAb::Grouping.find_or_initialize_by(user_id: user.id, experiment: experiment)
|
82
|
+
g.variant = variant
|
83
|
+
g.save!
|
84
|
+
g
|
85
|
+
end
|
86
|
+
|
80
87
|
private
|
81
88
|
|
82
89
|
def find_ab_test_user_recognition(options = {})
|
@@ -1,10 +1,11 @@
|
|
1
1
|
module EasyAb
|
2
2
|
module RSpec
|
3
3
|
module SpecHelper
|
4
|
-
def assign_variant(user, experiment, variant)
|
4
|
+
def assign_variant!(user, experiment, variant)
|
5
5
|
g = EasyAb::Grouping.find_or_initialize_by(user_id: user.id, experiment: experiment)
|
6
6
|
g.variant = variant
|
7
7
|
g.save!
|
8
|
+
g
|
8
9
|
end
|
9
10
|
end
|
10
11
|
end
|
data/lib/easy_ab/version.rb
CHANGED