mirror of
https://github.com/heartcombo/simple_form.git
synced 2022-11-09 12:19:26 -05:00
Fix broken tests
This commit is contained in:
parent
cc2ad0e283
commit
8d5dcfde43
2 changed files with 4 additions and 0 deletions
|
@ -29,8 +29,11 @@ module SimpleForm
|
|||
def has_tokenizer?(length_validator)
|
||||
tokenizer = length_validator.options[:tokenizer]
|
||||
|
||||
# TODO: Remove this check when we drop Rails 3.0 support
|
||||
if ActiveModel::Validations::LengthValidator.const_defined?(:DEFAULT_TOKENIZER)
|
||||
tokenizer && tokenizer != ActiveModel::Validations::LengthValidator::DEFAULT_TOKENIZER
|
||||
else
|
||||
tokenizer
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -192,6 +192,7 @@ class OtherValidatingUser < User
|
|||
|
||||
validates_format_of :country, :with => /\w+/
|
||||
|
||||
# TODO: Remove this check when we drop Rails 3.0 support
|
||||
if ActiveModel::VERSION::MAJOR == 3 && ActiveModel::VERSION::MINOR >= 1
|
||||
validates_format_of :name, :with => Proc.new { /\w+/ }
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue