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