whisk-rails 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/whisk/rails.rb +5 -0
- data/lib/whisk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd07b3040b0dfc9ba0fcb8ed6910a88128ff18e1
|
4
|
+
data.tar.gz: ee66ab8c0021cccccf85f8e9c7438a65f6ebaf24
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964bf393543cdf1c43de79277bafef6945a40d3b4ccb1aa208d49fbe9b41477baeffd46d417d780f0f33e60948163d0e030bb0ec7f79850e357e0f38b238cf73
|
7
|
+
data.tar.gz: fada707ef74b589dcc1123f9e91c79a994f27823b72f7d3d0049234f69e0161662b899c76f70d30d1180db33e9bd0ef29a0a01083046e875608408ba0f900bba
|
data/lib/whisk/rails.rb
CHANGED
@@ -2,6 +2,7 @@ module Whisk
|
|
2
2
|
module Rails
|
3
3
|
class << self
|
4
4
|
def scramble(model, fields = [])
|
5
|
+
set_fakers_locale
|
5
6
|
klass = model.classify.constantize
|
6
7
|
klass.unscoped.each do |instance|
|
7
8
|
scramble_fields_for(instance, fields)
|
@@ -10,6 +11,10 @@ module Whisk
|
|
10
11
|
|
11
12
|
private
|
12
13
|
|
14
|
+
def set_fakers_locale
|
15
|
+
Faker::Config.locale = I18n.locale
|
16
|
+
end
|
17
|
+
|
13
18
|
def scramble_fields_for(object, fields)
|
14
19
|
fields.each do |field|
|
15
20
|
begin
|
data/lib/whisk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whisk-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dunya Kirkali
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faker
|