Error when use a symbol on greater than (numericality validator) #981

Closed
sobrinho opened this Issue Jan 6, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@sobrinho
Collaborator

sobrinho commented Jan 6, 2014

Working on legacy rails application, not sure if that happens on most recent rails but I'm assuming that's a bug since formtastic 2.2.1 is compatible with 3.1.12.

class Program < ActiveRecord::Base
  # age_beginning is another column on same table.
  validates :age_end, :numericality => { :greater_than => :age_beginning }, :allow_blank => true
end
<%= f.input :age_beginning, :input_html => { :size => 20 } %>
<%= f.input :age_end, :input_html => { :size => 20 } %>
undefined method `+' for :age_beginning:Symbol

formtastic (2.2.1) lib/formtastic/inputs/base/validations.rb:80:in `validation_min'
formtastic (2.2.1) lib/formtastic/inputs/base/numeric.rb:30:in `min_option'
formtastic (2.2.1) lib/formtastic/inputs/base/numeric.rb:16:in `input_html_options'
formtastic (2.2.1) lib/formtastic/inputs/base/placeholder.rb:7:in `input_html_options'
formtastic (2.2.1) lib/formtastic/inputs/base/labelling.rb:15:in `label_html_options'
formtastic (2.2.1) lib/formtastic/inputs/base/labelling.rb:9:in `label_html'
formtastic (2.2.1) lib/formtastic/inputs/number_input.rb:77:in `block in to_html'
actionpack (3.1.12) lib/action_view/helpers/capture_helper.rb:40:in `block in capture'
actionpack (3.1.12) lib/action_view/helpers/capture_helper.rb:187:in `with_output_buffer'
haml (3.1.8) lib/haml/helpers/xss_mods.rb:109:in `with_output_buffer_with_haml_xss'
actionpack (3.1.12) lib/action_view/helpers/capture_helper.rb:40:in `capture'
haml (3.1.8) lib/haml/helpers/action_view_mods.rb:105:in `capture_with_haml'
formtastic (2.2.1) lib/formtastic/inputs/base/wrapping.rb:11:in `input_wrapping'
formtastic (2.2.1) lib/formtastic/inputs/number_input.rb:76:in `to_html'
formtastic (2.2.1) lib/formtastic/helpers/input_helper.rb:240:in `input'
app/views/programs/_form.html.erb:12:in `block (2 levels) in _app_views_programs__form_html_erb___1306728506117404752_70218917961560'
@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Apr 19, 2014

Owner

@sobrinho in 2.3.x we've deprecated Rails < 3.2.13 and in master we require >= 3.2.13. You mentioned Rails 3.1.12 in your description. Is it worth fixing this, or closing and moving on?

Owner

justinfrench commented Apr 19, 2014

@sobrinho in 2.3.x we've deprecated Rails < 3.2.13 and in master we require >= 3.2.13. You mentioned Rails 3.1.12 in your description. Is it worth fixing this, or closing and moving on?

@sobrinho

This comment has been minimized.

Show comment Hide comment
@sobrinho

sobrinho Apr 25, 2014

Collaborator

@justinfrench I'm going to fix this, it's bugging me here :(

Collaborator

sobrinho commented Apr 25, 2014

@justinfrench I'm going to fix this, it's bugging me here :(

@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Jul 26, 2014

Owner

Fixed by #1034

Owner

justinfrench commented Jul 26, 2014

Fixed by #1034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment