Skip to content

Commit

Permalink
Fix incorrect readme instructions (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavbiswa authored Apr 6, 2024
1 parent bd986a6 commit a1d8bbc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ end
```
To populate the anonymized columns, run the following command:

$ bin/rails anonymize:populate CLASS=User
$ bin/rails anonymizer:populate CLASS=User

The `CLASS` argument is optional, if not provided, it will anonymize all the models with anonymized columns.

Expand All @@ -71,9 +71,9 @@ Attributes can be anonymized using the `anonymize` method. The `anonymize` metho
```ruby
class User < ApplicationRecord
anonymize :first_name, :last_name
anonymize :email, with: ->(email) { Faker::Internet.email }
anonymize :age, with: ->(age) { age + 5 }
anonymize :phone, column_name: :fake_phone_number, with: ->(phone) { phone.gsub(/\d/, 'X') }
anonymize :email, with: ->(_record) { Faker::Internet.email }
anonymize :age, with: ->(record) { record.age + 5 }
anonymize :phone, column_name: :fake_phone_number, with: ->(record) { record.phone.gsub(/\d/, 'X') }
anonymize :address, encrypt: true
end
```
Expand Down

0 comments on commit a1d8bbc

Please sign in to comment.