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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba5f1b022f3d278a5f22778fe6f6311242c97e0f
4
- data.tar.gz: d58d595789093a379333ea4c96881a9002c06464
3
+ metadata.gz: fd07b3040b0dfc9ba0fcb8ed6910a88128ff18e1
4
+ data.tar.gz: ee66ab8c0021cccccf85f8e9c7438a65f6ebaf24
5
5
  SHA512:
6
- metadata.gz: 383e5945ce883f0370ef2b1be80da8e27710ff73def13adda0cd4692840b9180b0710086d4ceaff30556bb24f6221fd36525304ee629d618dbf1167bbd09e57b
7
- data.tar.gz: 88dcae5495864be37ee175ef14dc637bf66930da17c0ad9c130fd96456e214d20a69ed1e23fc792eebe902899cc2e75a1dda0b673f686e8270b11cf5ea320cd9
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
@@ -1,3 +1,3 @@
1
1
  module Whisk
2
- VERSION = '0.3.0'
2
+ VERSION = '0.4.0'
3
3
  end
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.3.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-04-26 00:00:00.000000000 Z
12
+ date: 2016-05-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faker