diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 04:44:58 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 04:44:58 +0000 |
commit | d5cadfc1108728635055d476eff7b34c975705d6 (patch) | |
tree | 8fd34ee0fc1512d5b0cbfcfd5aa62b06f00a9d94 /activerecord/lib | |
parent | 6f5fcc44699e50b54301d2005180e443da45be8f (diff) | |
download | rails-d5cadfc1108728635055d476eff7b34c975705d6.tar.gz rails-d5cadfc1108728635055d476eff7b34c975705d6.tar.bz2 rails-d5cadfc1108728635055d476eff7b34c975705d6.zip |
Address parsing failed when the "to" (or "cc", or whatever) was an array. It was also too restrictive in the formats of the addresses #1097 [Jamis]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/validations.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 9364a2501c..850d012e4d 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -369,27 +369,27 @@ module ActiveRecord # Declare different validations per option. case range_options.first when :within, :in - raise ArgumentError, ':within must be a Range' unless option_value.is_a?(Range) + raise ArgumentError, ':within must be a Range' unless option_value.is_a?(Range) # ' validates_each(attrs, options) do |record, attr| next if record.send(attr).nil? and options[:allow_nil] record.errors.add_on_boundary_breaking(attr, option_value, options[:too_long], options[:too_short]) end when :is - raise ArgumentError, ':is must be a nonnegative Integer' unless option_value.is_a?(Integer) and option_value >= 0 + raise ArgumentError, ':is must be a nonnegative Integer' unless option_value.is_a?(Integer) and option_value >= 0 # ' message = options[:message] || options[:wrong_length] message = (message % option_value) rescue message validates_each(attrs, options) do |record, attr, value| record.errors.add(attr, message) if value.nil? or value.size != option_value end when :minimum - raise ArgumentError, ':minimum must be a nonnegative Integer' unless option_value.is_a?(Integer) and option_value >= 0 + raise ArgumentError, ':minimum must be a nonnegative Integer' unless option_value.is_a?(Integer) and option_value >= 0 # ' message = options[:message] || options[:too_short] message = (message % option_value) rescue message validates_each(attrs, options) do |record, attr, value| record.errors.add(attr, message) if value.nil? or value.size < option_value end when :maximum - raise ArgumentError, ':maximum must be a nonnegative Integer' unless option_value.is_a?(Integer) and option_value >= 0 + raise ArgumentError, ':maximum must be a nonnegative Integer' unless option_value.is_a?(Integer) and option_value >= 0 # ' message = options[:message] || options[:too_long] message = (message % option_value) rescue message validates_each(attrs, options) do |record, attr, value| |