From 7464964b4a39cc99ed6af6d6648965820c7aa747 Mon Sep 17 00:00:00 2001 From: Anna Carey Date: Mon, 23 Sep 2019 13:52:33 -0400 Subject: [PATCH] use email address for unique-ish id for feature toggles (#3323) * use email address for unique-ish id for feature toggles * no need for user prefix any more --- app/models/user.rb | 2 +- spec/models/user_spec.rb | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/models/user.rb b/app/models/user.rb index 6ee5f5c6c05..c988a9e18f5 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -290,7 +290,7 @@ def power_of_attorney end def flipper_id - "User;#{account_uuid}" + email || account_uuid end private diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index dbb041f097c..315f9c7976d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -383,6 +383,13 @@ end end + describe '#flipper_id' do + let(:user) { build(:user, :loa3) } + it 'should return a unique identifier of email' do + expect(user.flipper_id).to eq(user.email) + end + end + describe '#va_patient?' do let(:user) { build(:user, :loa3) }