We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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'
method_missing' /usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/association_conditions.rb:19:in
method_missing' /usr/lib/ruby/gems/1.8/gems/searchlogic-2.4.19/lib/searchlogic/named_scopes/ordering.rb:30:in
method_missing' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in
method_missing' /home//Apps/pj/app/models/event.rb:17 /home//Apps/pj/app/controllers/events_controller.rb:12:in
The text was updated successfully, but these errors were encountered:
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.
Sorry, something went wrong.
I am using it as a plugin and I had to restart webrick(doh!). Thanks for the suggestion regarding lambda. Great plugin!!
No branches or pull requests
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:in
method_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:in
method_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:in
method_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:in
index'The text was updated successfully, but these errors were encountered: