From b3a71f24075fc2c91058c9340e7a06a7eb058a6e Mon Sep 17 00:00:00 2001
From: Keshav Biswa <keshavbiswa21@gmail.com>
Date: Sat, 16 Mar 2024 21:23:38 +0530
Subject: [PATCH] Replaced staging with development (#11)

---
 README.md                                                 | 4 ++--
 lib/active_record_anonymizer/configuration.rb             | 2 +-
 .../active_record_anonymizer/templates/anonymizer.rb      | 2 +-
 test/configuration_test.rb                                | 8 ++++----
 test/environment_check_test.rb                            | 2 +-
 test/generators/install_generator_test.rb                 | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/README.md b/README.md
index f9add10..dc4879f 100644
--- a/README.md
+++ b/README.md
@@ -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}
diff --git a/lib/active_record_anonymizer/configuration.rb b/lib/active_record_anonymizer/configuration.rb
index 9fa100c..353f6d8 100644
--- a/lib/active_record_anonymizer/configuration.rb
+++ b/lib/active_record_anonymizer/configuration.rb
@@ -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"
diff --git a/lib/generators/active_record_anonymizer/templates/anonymizer.rb b/lib/generators/active_record_anonymizer/templates/anonymizer.rb
index dbee771..5689e09 100644
--- a/lib/generators/active_record_anonymizer/templates/anonymizer.rb
+++ b/lib/generators/active_record_anonymizer/templates/anonymizer.rb
@@ -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
diff --git a/test/configuration_test.rb b/test/configuration_test.rb
index 9a75a43..3c3adf0 100644
--- a/test/configuration_test.rb
+++ b/test/configuration_test.rb
@@ -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
@@ -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
diff --git a/test/environment_check_test.rb b/test/environment_check_test.rb
index 588eb08..5f989fc 100644
--- a/test/environment_check_test.rb
+++ b/test/environment_check_test.rb
@@ -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
diff --git a/test/generators/install_generator_test.rb b/test/generators/install_generator_test.rb
index 96a48f1..090971d 100644
--- a/test/generators/install_generator_test.rb
+++ b/test/generators/install_generator_test.rb
@@ -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