Validates_presence_of with a Date

Hi,
I’m seeing a strange error when I use validates_presence_of with a date
attribute

validates_presence_of :closing_date, :user, :product

When I remove :closing_date it works fine.

The stack trace and error is as follows:

ArgumentError in BuyController#home
wrong number of arguments (1 for 0)

C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/callbacks.rb:328:in
notify' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/callbacks.rb:328:incallback’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.2/lib/active_record/callbacks.rb:308:in
valid?' #{RAILS_ROOT}/app/controllers/buy_controller.rb:17:inhome’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:910:in
perform_action_without_filters' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:368:inperform_action_without_benchmark’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/benchmark.rb:293:inmeasure’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/benchmarking.rb:69:in
perform_action_without_rescue' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/rescue.rb:82:inperform_action’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/base.rb:381:in
process_without_filters' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/filters.rb:377:inprocess_without_session_management_support’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/session_management.rb:117:in
process' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:indispatch’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:115:in
handle_dispatch' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:81:inservice’
C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:104:in
service' C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/httpserver.rb:65:inrun’
C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:173:in
start_thread' C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:162:instart_thread’
C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:95:in
start' C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:92:instart’
C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:23:in
start' C:/cengal/apps/InstantRails/ruby/lib/ruby/1.8/webrick/server.rb:82:instart’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/webrick_server.rb:67:in
dispatch' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/servers/webrick.rb:59 C:/cengal/apps/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
require' C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/commands/server.rb:30 C:/cengal/apps/InstantRails/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:inrequire’
C:/cengal/apps/InstantRails/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:147:in
`require’
script/server:3
-e:4

Any thoughts?

Thanks,
John

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs