mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
Type cast ActiveSupport::Duration before compiling it.
This commit is contained in:
parent
cbb4796599
commit
c12651104b
1 changed files with 12 additions and 8 deletions
|
@ -60,9 +60,14 @@ module Devise
|
|||
|
||||
# Convert new keys to methods which overwrites Devise defaults
|
||||
options.each do |key, value|
|
||||
if value.is_a?(Proc)
|
||||
case value
|
||||
when Proc
|
||||
define_method key, &value
|
||||
else
|
||||
next
|
||||
when ActiveSupport::Duration
|
||||
value = value.to_i
|
||||
end
|
||||
|
||||
class_eval <<-END_EVAL, __FILE__, __LINE__
|
||||
def #{key}
|
||||
#{value.inspect}
|
||||
|
@ -70,7 +75,6 @@ module Devise
|
|||
END_EVAL
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Stores all modules included inside the model, so we are able to verify
|
||||
# which routes are needed.
|
||||
|
|
Loading…
Reference in a new issue