black_and_white 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/black_and_white/helpers/database.rb +10 -2
- data/lib/black_and_white/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: 579a1f71214e978a74e7a8f43c02cb3220c33fe0
|
4
|
+
data.tar.gz: 422a80af8edca9d2168bd2dc0a324639618bf2c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fdd44ff52bcde3a8247bca43ccbc75bbaaf855d7565a28a6ece023f8f8e1c5c1b2d425db98e0ea6e914228b9f9de4ac1d9e2931b8afaac15d9584bb3386a534
|
7
|
+
data.tar.gz: 7642b27356e3a2664c028a99fe3ac8edef07dc8ef81a976332c7ac38f7fcf324c49d7046d12c98b990fda923772b6aa6abce5c6afde512c8e898859be214837d
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
Add this line to your application's Gemfile:
|
11
11
|
|
12
12
|
```ruby
|
13
|
-
gem 'black_and_white', '~> 0.1.
|
13
|
+
gem 'black_and_white', '~> 0.1.5'
|
14
14
|
```
|
15
15
|
|
16
16
|
And then execute:
|
@@ -33,7 +33,7 @@ this will create a `black_and_white.rb` config file in
|
|
33
33
|
BlackAndWhite.configure do |config|
|
34
34
|
config.bw_class = 'User'
|
35
35
|
config.bw_class_table = :users
|
36
|
-
config.bw_main_table = :
|
36
|
+
config.bw_main_table = :ab_tests
|
37
37
|
config.bw_join_table = :ab_tests_users
|
38
38
|
end
|
39
39
|
|
@@ -15,8 +15,8 @@ RUBY
|
|
15
15
|
|
16
16
|
def bw_relations_table_data
|
17
17
|
<<RUBY
|
18
|
-
t.references :#{
|
19
|
-
t.references :#{
|
18
|
+
t.references :#{bw_tests_class_table_singularize}, index: true
|
19
|
+
t.references :#{bw_tests_table_name_singularize}, index: true
|
20
20
|
RUBY
|
21
21
|
end
|
22
22
|
|
@@ -25,6 +25,10 @@ RUBY
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def bw_tests_table_name
|
28
|
+
BlackAndWhite.config.bw_main_table
|
29
|
+
end
|
30
|
+
|
31
|
+
def bw_tests_table_name_singularize
|
28
32
|
BlackAndWhite.config.bw_main_table.to_s.singularize
|
29
33
|
end
|
30
34
|
|
@@ -33,6 +37,10 @@ RUBY
|
|
33
37
|
end
|
34
38
|
|
35
39
|
def bw_tests_class_table
|
40
|
+
BlackAndWhite.config.bw_class_table
|
41
|
+
end
|
42
|
+
|
43
|
+
def bw_tests_class_table_singularize
|
36
44
|
BlackAndWhite.config.bw_class_table.to_s.singularize
|
37
45
|
end
|
38
46
|
|