mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-25 15:22:58 +00:00
fix for validation nil value with :format option plugin parser disabled (issue 34)
This commit is contained in:
10
spec/support/config_helper.rb
Normal file
10
spec/support/config_helper.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
module ConfigHelper
|
||||
# Justin French tip
|
||||
def with_config(preference_name, temporary_value)
|
||||
old_value = ValidatesTimeliness.send(preference_name)
|
||||
ValidatesTimeliness.send(:"#{preference_name}=", temporary_value)
|
||||
yield
|
||||
ensure
|
||||
ValidatesTimeliness.send(:"#{preference_name}=", old_value)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user