Skip to content

Commit

Permalink
Replaced staging with development (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavbiswa authored Mar 16, 2024
1 parent 1961d7f commit b3a71f2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ end

You can configure the gem using the following options:

- `:environments` - The environments in which the anonymized data should be used. (Defaults to `[:staging]`)
- `:environments` - The environments in which the anonymized data should be used. (Defaults to `[:development]`)
- `:skip_update` - Skip updating the anonymized data when the record is updated. This ensures your anonymized data remains the same even if it's updated. (Defaults to `false`)
- `:alias_original_columns` - Alias the original columns to the anonymized columns. You can still access the original value of the attribute using the alias `original_#{attribute_name}`(Defaults to `false`)
- `:alias_column_name` - The name of the alias column. (Defaults to `original_#{column_name}`)

```ruby
ActiveRecordAnonymizer.configure do |config|
config.environments = [:staging, :production] # The environments in which the anonymized data should be used
config.environments = [:development, :staging] # The environments in which the anonymized data should be used
config.skip_update = true # Skip updating the anonymized data when the record is updated
config.alias_original_columns = true # Alias the original columns to the anonymized columns
config.alias_column_name = "original" # The original column will be aliased to "original_#{column_name}
Expand Down
2 changes: 1 addition & 1 deletion lib/active_record_anonymizer/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Configuration
attr_accessor :environments, :skip_update, :alias_original_columns, :alias_column_name

def initialize
@environments = %i[staging]
@environments = %i[development]
@skip_update = false
@alias_original_columns = false
@alias_column_name = "original"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ActiveRecordAnonymizer.configure do |config|
# Configure the environments in which anonymization is allowed.
config.environments = %i[staging]
config.environments = %i[development]

# Uncomment the following line to skip updating anonymized_columns when updating the original columns.
# config.skip_update = true
Expand Down
8 changes: 4 additions & 4 deletions test/configuration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require_relative "../test/test_helper"

class ConfigurationTest < ActiveSupport::TestCase
# The reason why this returns test and not staging even though
# the default value is set to staging is because the configuration
# The reason why this returns test and not development even though
# the default value is set to development is because the configuration
# is overwritten in the test_helper.rb file.
test "default environments" do
assert_equal %i[test], ActiveRecordAnonymizer.configuration.environments
Expand All @@ -23,8 +23,8 @@ class ConfigurationTest < ActiveSupport::TestCase
end

test "custom environments" do
ActiveRecordAnonymizer.configuration.stubs(:environments).returns(%i[staging test])
assert_equal %i[staging test], ActiveRecordAnonymizer.configuration.environments
ActiveRecordAnonymizer.configuration.stubs(:environments).returns(%i[development test])
assert_equal %i[development test], ActiveRecordAnonymizer.configuration.environments
end

test "alias_original_columns" do
Expand Down
2 changes: 1 addition & 1 deletion test/environment_check_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class EnvironmentCheckTest < ActiveSupport::TestCase
setup do
ActiveRecordAnonymizer.configuration.stubs(:environments).returns(%i[staging])
ActiveRecordAnonymizer.configuration.stubs(:environments).returns(%i[development])
end

test "Does not return the anonymized value if anonymization is disabled" do
Expand Down
2 changes: 1 addition & 1 deletion test/generators/install_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
ActiveRecordAnonymizer.configure do |config|
# Configure the environments in which anonymization is allowed.
config.environments = %i[staging]
config.environments = %i[development]
# Uncomment the following line to skip updating anonymized_columns when updating the original columns.
# config.skip_update = true
Expand Down

0 comments on commit b3a71f2

Please sign in to comment.