Skip to content

Commit

Permalink
Remove unneeded method
Browse files Browse the repository at this point in the history
  • Loading branch information
Tabby committed Feb 19, 2025
1 parent f444e12 commit a6be0f0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
12 changes: 0 additions & 12 deletions lib/anony/anonymisable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,6 @@ def selector_for?(subject)
anonymise_config.selector_for?(subject)
end

# Checks if a model uses a strategy that requires anonymisation. Returns false if the strategy
# is ignore, or true for all other strategies
# This is useful for checking to see whether a model needs to be anonymised or not.
# @return [Boolean]
# @example
# Manager.requires_anonymisation?
def requires_anonymisation?
return false unless @anonymise_config

!@anonymise_config.instance_variable_get(:@strategy).is_a? Strategies::Ignore
end

attr_reader :anonymise_config
end

Expand Down
18 changes: 0 additions & 18 deletions spec/anony/anonymisable_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,6 @@ def some_instance_method?
end
end
end

describe "#requires_anonymisation?" do
it "requires anonymisation" do
expect(klass.requires_anonymisation?).to be true
end
end
end

context "destroy on anonymise" do
Expand Down Expand Up @@ -152,12 +146,6 @@ def some_instance_method?
expect(klass).to be_valid_anonymisation
end
end

describe "#requires_anonymisation?" do
it "requires anonymisation" do
expect(klass.requires_anonymisation?).to be true
end
end
end

context "ignore anonymise" do
Expand Down Expand Up @@ -193,12 +181,6 @@ def some_instance_method?
expect(klass).to be_valid_anonymisation
end
end

describe "#requires_anonymisation?" do
it "does not require anonymisation" do
expect(klass.requires_anonymisation?).to be false
end
end
end

context "preventing anonymisation" do
Expand Down

0 comments on commit a6be0f0

Please sign in to comment.