Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No method error #9

Closed
badnaam opened this issue Apr 25, 2010 · 2 comments
Closed

No method error #9

badnaam opened this issue Apr 25, 2010 · 2 comments

Comments

@badnaam
Copy link

badnaam commented Apr 25, 2010

This is what I have in my model.

validates_datetime :event_date, :on_or_after => Time.now, :on_or_before_message => "Event date/time must be in the future."

I am on rails 2.3.5 and I see this error

undefined method `validates_datetime' for #Class:0x7f55bbf394c8

RAILS_ROOT: /home//Apps/pj
Application Trace | Framework Trace | Full Trace

/usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/conditions.rb:81:in method_missing' /usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/association_conditions.rb:19:inmethod_missing'
/usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/association_ordering.rb:27:in method_missing' /usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/ordering.rb:30:inmethod_missing'
/usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/or_conditions.rb:28:in method_missing' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:inmethod_missing_without_paginate'
/usr/lib/ruby/gems/1.8/gems/mislav-will_paginate-2.3.11/lib/will_paginate/finder.rb:170:in method_missing' /home//Apps/pj/app/models/event.rb:17 /home//Apps/pj/app/controllers/events_controller.rb:12:inindex'

@adzap
Copy link
Owner

adzap commented Apr 25, 2010

have you added the config.gem "validates_timeliness" in your environment.rb?

BTW you will want to put the Time.now in a lambda { } otherwise the time value with remain static while the app is running.

@badnaam
Copy link
Author

badnaam commented Apr 25, 2010

I am using it as a plugin and I had to restart webrick(doh!). Thanks for the suggestion regarding lambda. Great plugin!!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants