evil-seed 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 49f3bab8298bfc4a918791ff92abb7d60d63f7a8d14bbb37b353bfa59fe33818
4
- data.tar.gz: f11da93930102998a035b1ea83e1bc3c382ad829d43490a6ef7263af27d8e7c7
3
+ metadata.gz: d2a4c8714fe895573999dae43b0e441852c8baccba4657f49aa9330db61e020d
4
+ data.tar.gz: 175c040d61f8152437c15db6f4a38fa0941239f7615cf27aa1d752c57ffdbb5d
5
5
  SHA512:
6
- metadata.gz: f446f6c8634d9385d75f8ccdf7e2a76cdfea9b17886759ca63993a70044bc15e77f111442e9d323c4c158907c7751ee927c778b3c58e43c06f81bef737e26ff6
7
- data.tar.gz: 604448e710c92999cffe29a6e137a4cee328f3f8bec5b2c44fa5c3ee3fb9b1393c87b104c2826e8792f4724cec34bfd576bd55e588dfc8bdd50eb63c991e0a56
6
+ metadata.gz: 427ec05a9b68db21101fdf293093dff447635e9b326dfd400e3d7ba69afe3a3344bfa4c97778a8c56f2158529460df9f2e1cbc62a5b9ad86e7d659498e9da37d
7
+ data.tar.gz: 2288cfb2559bc3b6eefeb28f066cb06e6ed2e0c624e5287755314e41e67a611341d90c4c9d08f97d7a724882b294bdc3dbb53ebfbe4ac431f06a078ed1ea76fc
data/README.md CHANGED
@@ -72,10 +72,12 @@ EvilSeed.configure do |config|
72
72
  end
73
73
 
74
74
  # Transformations allows you to change dumped data e. g. to hide sensitive information
75
- config.customize("User") do |user_attributes|
75
+ config.customize("User") do |u|
76
76
  # Reset password for all users to the same for ease of debugging on developer's machine
77
77
  u["encrypted_password"] = encrypt("qwerty")
78
- u["created_at"] =
78
+ # Reset or mutate other attributes at your convenience
79
+ u["metadata"].merge!("foo" => "bar")
80
+ u["created_at"] = Time.current
79
81
  # Please note that there you have only hash of record attributes, not the record itself!
80
82
  end
81
83
 
@@ -84,6 +86,7 @@ EvilSeed.configure do |config|
84
86
  config.anonymize("User")
85
87
  name { Faker::Name.name }
86
88
  email { Faker::Internet.email }
89
+ login { |login| "#{login}-test" }
87
90
  end
88
91
  ```
89
92
 
@@ -27,7 +27,7 @@ module EvilSeed
27
27
  def call(attributes)
28
28
  attributes.deep_dup.tap do |attrs|
29
29
  @changers.each do |attribute, changer|
30
- attrs[attribute] = changer.call
30
+ attrs[attribute] = changer.call(attrs[attribute])
31
31
  end
32
32
  end
33
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EvilSeed
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: evil-seed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey Novikov
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2022-03-09 00:00:00.000000000 Z
12
+ date: 2022-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord