Skip to content

Commit

Permalink
Rubocop cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
keshavbiswa committed Mar 16, 2024
1 parent 95c6840 commit 01832f0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/active_record_anonymizer/initiator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def validate
def configure_anonymization
attributes.each do |attribute|
anonymized_column = anonymized_column_name(attribute)

# I don't like that we're manipulating the class attribute here
# This breaks the SRP for this method
# TODO:- Will need to revisit how we set the class attribute later
Expand Down
4 changes: 2 additions & 2 deletions test/active_record_anonymizer/initiator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ActiveRecordAnonymizer::InitiatorTest < ActiveSupport::TestCase
test "#validate raises InvalidArgumentsError error if with and column_names are provided for attributes more than one" do
error = assert_raises ActiveRecordAnonymizer::InvalidArgumentsError do
@anonymizer = ActiveRecordAnonymizer::Initiator.new(UserWithoutAnonymizeMethod, %i[first_name last_name email], with: "John Doe",
column_name: "John Doe")
column_name: "John Doe")
@anonymizer.validate
end

Expand All @@ -37,7 +37,7 @@ class ActiveRecordAnonymizer::InitiatorTest < ActiveSupport::TestCase

assert_changes -> { user.first_name }, from: "John", to: "" do
anonymizer = ActiveRecordAnonymizer::Initiator.new(UserWithoutAnonymizeMethod, %i[email first_name last_name])
anonymizer.configure_anonymization
anonymizer.configure_anonymization
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions test/dummy/app/models/validated_user.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

class ValidatedUser < ApplicationRecord
validates :first_name, presence: true
validates :last_name, presence: true
Expand Down
1 change: 0 additions & 1 deletion test/validation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,3 @@ class ValidationTest < ActiveSupport::TestCase
assert_equal "anonymized_word", user.email
end
end

0 comments on commit 01832f0

Please sign in to comment.