From 0eb977b4c6dafdecaa6d0861783ebb502de3981f Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Tue, 6 Oct 2015 15:14:59 +0100 Subject: [PATCH] Temporary fix for heapsource/active_model_otp#26 https://github.com/heapsource/active_model_otp/issues/26 --- lib/active_model/one_time_password.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/active_model/one_time_password.rb b/lib/active_model/one_time_password.rb index 7da5cf1..e04cf2e 100644 --- a/lib/active_model/one_time_password.rb +++ b/lib/active_model/one_time_password.rb @@ -96,11 +96,19 @@ def otp_column=(attr) end def otp_counter - self.public_send(self.class.otp_counter_column_name) + if self.class.otp_counter_column_name != 'otp_counter' + self.public_send(self.class.otp_counter_column_name) + else + super + end end def otp_counter=(attr) - self.public_send("#{self.class.otp_counter_column_name}=", attr) + if self.class.otp_counter_column_name != 'otp_counter' + self.public_send("#{self.class.otp_counter_column_name}=", attr) + else + super + end end end end