From 21c0a1f3016b1de81f455f2a242803db91f96f17 Mon Sep 17 00:00:00 2001 From: Griffin Smith Date: Fri, 10 Jul 2015 11:32:18 -0400 Subject: Support :if and :unless in has_secure_token Pass through :if and :unless options from has_secure_token to the generated before_create callback --- activerecord/test/models/user.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activerecord/test/models') diff --git a/activerecord/test/models/user.rb b/activerecord/test/models/user.rb index f5dc93e994..a40385e047 100644 --- a/activerecord/test/models/user.rb +++ b/activerecord/test/models/user.rb @@ -1,6 +1,9 @@ class User < ActiveRecord::Base has_secure_token has_secure_token :auth_token + has_secure_token :conditional_token, if: :token_condition + + attr_accessor :token_condition end class UserWithNotification < User -- cgit v1.2.3