Commit 843b1de0 authored by Alexis Reigel's avatar Alexis Reigel
Browse files

simplify nil handling

parent 5e55b8ac97fb
......@@ -46,8 +46,7 @@ def fingerprint
end
def key=(value)
value.strip! unless value.blank?
write_attribute(:key, value)
super(value&.strip)
end
def user_infos
......
......@@ -44,6 +44,10 @@
expect(described_class.new(key: " #{key} ").key).to eq(key)
end
it 'does not strip when the key is nil' do
expect(described_class.new(key: nil).key).to be_nil
end
end
describe '#user_infos' do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment